1 Reply Latest reply on Jul 25, 2014 1:34 PM by Greybird-Oracle

    How BDB-HE handles large transaction?




      I'm using BDB-JE 5.0.43 release, I have a transaction related question.


      When I'm reading Getting Started with Berkeley DB, Java Edition Transaction Processing, a question pops up in my head, that is if I open a transaction handler and perform a lot of insertions(all new data, say 100 million objects) within this handler, so before I commit the transaction,  is all data kept in memory? I guess, No, but where it goes? A special log file? and if I rollback the transaction, does it involve very expensive I/O operation?





        • 1. Re: How BDB-HE handles large transaction?

          JE uses it's data log (the .jdb files) to log transactions, which is a technique similar to other databases.  Records in a transaction are logged prior to commit, and if the transaction aborts they are undone.  This is the standard approach.


          If you create a very large transaction, however, you will risk running out of memory due to locks.  Locks are held for each record in JE.  Large transactions should be avoided with any database for many reasons, but in particular with databases that perform per-record locking like JE.