There is a serious problem with the way transactions
are handled. When you nest > 200 child transactions
under a single parent transaction, Env.TxnBegin ()
hangs at an endless loop and the program must be
manually aborted.
The hang happens at
BerkeleyDb.Set<BerkeleyDb.Txn>.FindSlot(BerkeleyDb.Txn
key = {BerkeleyDb.Txn}, out int indx = 60) Line 320 +
0x8 bytes
as reported by the vs2005 debugger.
I think this might be caused by improperly cleaning up
the transactions after being commited or aborted, but i
haven't inspected the libdb-dotnet code properly yet.
I have attached a test case that writes 1000 random
entries to a dummy database: it starts a big
transaction and then tries to write every item under a
child transaction and commit the big one at the end if
all goes well. In my system, the program crashes after
about 250 inserts.
Test case
Logged In: YES
user_id=290026
This is actually a bug in the hash table (Set<T>) in Util.cs.
If by some coincidence all slots have been used at least
once, the insertion would loop forever. Thanks for finding it.
It has been there for a while (in others of my projects as
well) - I am surprised it never hit me before.
The bug is fixed in Util.cs rev. 1.6 in CVS.
Your example works now for me.
Please confirm if it works for you.
Logged In: YES
user_id=654072
Yes, I can confirm it works now.
Thanks, this bug was hitting me hard! :)