Problem with dba_open() on db4 database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am using a db4 database to store some values (on the local filesystem). Here the sample code:

$handle = dba_open("/var/cache/mydb.db", "cd", "db4");
[...]
$result = dba_replace($key, serialize($data), $handle);
[...]
dba_close($handle);

This Code is used in a CLI-Script (in an Asterisk-AGI-Script) and will be used by some processes in parallel. The online documentation (http://de1.php.net/manual/en/function.dba-open.php) shows, that the function should "wait" if more than a process has a lock on the database. This works fine if I use the script an execute it in differnt shells in parallel.

But SOMETIMES(!) I get (in the Asterisk-Environment) the following error message: dba_open(/var/cache/mydb.db,cd): Driver initialization failed for handler: db4: Unable to establish lock (database file already open)

So it seems, that the function "dba_open()" returns immediatly without waiting for lock release. But I do not know why ... ?!

I am using the following versions:
Ubuntu 12.04. LTS (up to date) with PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch

Any idea?

Thank in advance
-Thorsten-






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux