Concurrent reads & writes - 07-11-2005 , 09:08 PM
I am getting errors when sharing a database between two applications on two
Sometimes I am getting error "DB_LOCK->lock_put: Lock is no longer valid".
Even when there is no error, changes made in one application are not
readable from the other application.
Berkeley DB 4.2.52: (December 3, 2003) using C interface compiled with MS
Visual C 6.0, running under Windows 2000 sp4.
The application is a windows multi-threaded program that needs to run two
instances of the program on two separate PC's under windows. Both
application instances need multiple-reader/multiple-writer access. I use
the following flags with DBENV->open():
The application runs fine under heavy load when not sharing the database.
Re: Concurrent reads & writes - 07-11-2005 , 11:55 PM
It sounds like you are sharing the databases by having the environment
directory on a Windows network share. Unfortunately, if that is the
case, it is likely that mutexes are not working correctly:
If you need multi-threaded read-write access from more than one system,
you will need to implement some kind of network communication, such as
DCOM or .NET remoting.