1 Reply Latest reply: Jul 25, 2014 8:34 AM by Greybird-Oracle RSS

    How BDB-HE handles large transaction?

    1072560

      Hi,

       

      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?

       

      Thanks

       

      Anfernee

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

          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.

           

          --mark