This content has been marked as final. Show 1 reply
The BDB library is not re-entrant, so there is a strong possibility that a thread executing a BDB callback will self-deadlock if it makes another BDB call. You seem to be getting lucky in the particular case you are trying, but a slight change in timing or the other things going on in your application at the time could easily result in a deadlock. This is why we don't support making BDB calls from inside a BDB callback.
Generally, a BDB application inside the callback sets an internal variable of some kind to indicate that the event was received. Then another application thread or process acts on that variable, making any needed BDB calls.
We have a suggestion that might help in your particular case. It is possible to open databases for read and write access on a replication client. Any attempt to perform an actual write operation will fail on a client, but the open will succeed. So you can pre-open your databases for eventual write access while the site is still a client. This will allow the write operations to succeed after the site becomes master