Long-running Transactions and Timeouts
793421Aug 24 2010 — edited Aug 30 2010Hi.
I have a BDB (both 3.2.63 and 4.0.103 tried) database using the Java API, with an application that sometimes leaves transactions uncomitted, for various reasons. These uncommited transactions are indicative of an error condition, and can be safely rolled back, since if left un-comitted the bdb log files increase in sixe and rapidly begin to consume available disk space.
I have tried setting the 'je.txn.timeout' value to '1 s' to force transactions to timeout, however this doesn't seem to have any effect. I tested this by opening a transaction, waiting for 60 seconds (i.e. much more than the timeout) and trying to commit, expecting an exception to be thrown since the transaction would have timed out. Instead, I see the transaction marked as 'active' when i use JMX to query transaction statistics, and it stayed as active for the whole 60s. Once the commit had completed, the transaction completed as normal.
So, I have three questions:
1. How do I enable timeouts on bdb 3.x and 4.x
2. What should the effect of enabling timeouts be on a client?
3. Is this a valid solution to the problem of the bdb log file growing excessively with long-runing transactions?
Thanks,
Andrew.