BerkeleyDB concurrency -
08-07-2003
, 03:48 PM
I am trying to implement a concurrent database using the BerkeleyDB perl module and have two problems. (BerkeleyDB 0.23 with db-3.3.11)
The first is that when I try to create a second DB_WRITECURSOR cursor on the same database, instead of blocking, the call to db_cursor() returns status 22 "invalid argument". I can't figure this out. All the sleepycat docs claim that the call should block until the other lock is released? Is there a way to set the environment as nonblocking? I could not find that documented anywhere.
The second is that it appears from the BerkeleyDB.xs file that when DB_INIT_CDB is used to open the environment, then all cursors are created with the DB_WRITECURSOR flag set. But that means that you can not have multiple cursors at all and the whole consept of concurrency is out the window?
Can anyone elaborate on why that is so that I know what I might break if I go in and fix it? Is there a workaround already? How can I have concurrent access when all cursors are created as write cursors?
Thanks,
/Nathan. |