Using BDB XML Transactions with Berkeley DB Transactions

XmlTransaction objects are actually wrappers around Berkeley DB Transaction objects. It is therefore possible for you to use both XmlTransaction and Transaction handles for the same transaction simultaneously.

(Transaction objects are what Berkeley DB use to manage transactions. See the Berkeley DB Java version of this guide for details on their usage.)

This is interesting if you want to write an application that makes use of both Berkeley DB databases and Berkeley DB XML containers. Because BDB XML uses Berkeley DB for storage and transactions, all of the Berkeley DB APIs are available to your BDB XML application.

To obtain the underlying Transaction object from an XmlTransaction object, use XmlTransaction.getTransaction(). You can also create an XmlTransaction object around an existing Transaction object by passing that object to XmlManager.createTransaction().

When you use both BDB XML and Berkeley DB transaction handles for the same transaction simultaneously, there are a few things you need to keep in mind: