Failure getting record lock on a record from table

Hello Community,

we have an intranet website written by PHP. There we are using the odbc interface. Next to this website the customer is working with ProAlpha.

During the select statements these error messages are occurring:

[Mon Jul 20 11:48:13 2015] [error] [client 192.168.50.207] PHP Warning: odbc_exec(): SQL error: [unixODBC][DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Failure getting record lock on a record from table PUB.MLA_OnHand., SQL state S1000 in SQLExecDirect in /home/user1001/www/htdocs/home/inc/function_odbc.php on line 11
[Mon Jul 20 11:48:14 2015] [error] [client 192.168.50.207] PHP Warning: odbc_fetch_array() expects parameter 1 to be resource, boolean given in /home/user1001/www/htdocs/home/module/versand/versandliste.php on line 643

This is my php function, where i call each statement.
PHP:
function odbc_connection_check( $strSql )
{
    if ( StartsWith( $strSql, 'SELECT' ) == TRUE ) {
        //$strSql .= " WITH(NOLOCK) "
    }
   
    if ( $result = odbc_prepare ( $_SESSION [ 'odbc_connect_01' ], $strSql ) ) {
        $result = odbc_exec ( $_SESSION [ 'odbc_connect_01' ], $strSql );
               
        return $result;
    } else {
        die("The following error occurred in the statment ".$strSql);
    }
}

I already tried to add the WITH(NOLOCK) at each statement.

The odbc.ini looks like this

[ODBC Data Sources]
#Progress=Progress_SQL92_Driver
progress_production=Progress_SQL92_Driver
progress_test01=Progress_SQL92_Driver
progress_test02=Progress_SQL92_Driver

[progress_production]
Driver=/usr/dlc/odbc/lib/pgoe27.so
DatabaseName=pavar
PortNumber=12010
HostName=192.168.50.244
DefaultIsolationLevel = Read Uncommitted
DataSourceTransactionIsolation = Uncommitted

On the progress website i already found that i have to change DataSourceTransactionIsolation from
"Read Uncommited" to "Uncommited"
I tried both of them and the error is always occurring.

Ofcourse the dataset is locked by ProAlpha but how can i prevent this error message on each select statement.
 

RealHeavyDude

Well-Known Member
I don't know nothing about PHP - therefore my answer might not be applicable to you ...

Some time in the past I had a similar problem with Crystal Reports accessing an OpenEdge database via ODBC ( see knowledgebase article http://knowledgebase.progress.com/articles/Article/P119358 ).
Long story short: Crystal Reports uses it's own transaction isolation level thus overriding the setting on the ODBC driver. Maybe the same is true for PHP. Don't know where you would configure it if this is the case, though. In the end we came up not using the ODBC interface - instead using XML ( ADO.NET interface to Crystal Reports engine ).

Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
Sorry, it was completely my fault not stating more clearly that my response was just about PHP possibly overriding the transaction isolation level you have configured in the odbc.ini.

BTW, I really can't believe that the Powers that Be did not implement a registry in *nix ;)

Nevertheless, not knowing anything about PHP a quick google exercise brought this into the light of day:

Maybe this can finally be of any help to you :confused:

https://books.google.ch/books?id=lD...tion isolation level read uncommitted&f=false


Heavy Regards, RealHeavyDude.
 
Top