Berkeley DB XML
version 2.5.16

com.sleepycat.dbxml
Class XmlTransaction

java.lang.Object
  extended by com.sleepycat.dbxml.XmlTransaction

public class XmlTransaction
extends Object

The XmlTransaction class is the handle for a transaction. It encapsulates a Transaction object. Methods of the XmlTransaction class are used to abort and commit the transaction. XmlTransaction handles are provided to XmlContainer, XmlManager, and other objects that query and modify documents and containers in order to transactionally protect those database operations.

XmlTransaction objects are instantiated using XmlManager.createTransaction().

XmlTransaction handles are not free-threaded; transactions handles may be used by multiple threads, but only serially, that is, the application must serialize access to the XmlTransaction handle. Once the abort() or commit() methods are called, the handle may not be accessed again, regardless of the method's return. In addition, parent transactions may not issue any operations while they have active child transactions (child transactions that have not yet been committed or aborted) except for abort() and commit().


Constructor Summary
XmlTransaction()
           
 
Method Summary
 void abort()
          Cause an abnormal termination of the transaction.
 void commit()
          End the transaction.
 void commitNoSync()
          End the transaction without flushing the log.
 void commitSync()
          End the transaction and synchronously flush the log.
 Transaction getTransaction()
          Get the transaction handle encapsulated by this object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlTransaction

public XmlTransaction()
Method Detail

getTransaction

public Transaction getTransaction()
                           throws XmlException
Get the transaction handle encapsulated by this object.

Throws:
XmlException

abort

public void abort()
           throws XmlException
Cause an abnormal termination of the transaction. All write operations previously performed within the scope of the transaction are undone. Before this method returns, any locks held by the transaction will have been released.

In the case of nested transactions, aborting a parent transaction causes all children (unresolved or not) of the parent transaction to be aborted.

After this method has been called, regardless of its return, the XmlTransaction method handle may not be accessed again.

Throws:
XmlException

commit

public void commit()
            throws XmlException
End the transaction. Whether the log is flushed synchronously is determined by the settings for the database environment (the default is to flush the log).

After this method has been called, regardless of its return, the XmlTransaction handle may not be accessed again. If this method encounters an error, the transaction and all child transactions of the transaction are aborted.

Throws:
XmlException

commitSync

public void commitSync()
                throws XmlException
End the transaction and synchronously flush the log. This means the transaction will exhibit all of the ACID (atomicity, consistency, isolation, and durability) properties.

After this method has been called, regardless of its return, the XmlTransaction handle may not be accessed again. If this method encounters an error, the transaction and all child transactions of the transaction are aborted.

Throws:
XmlException

commitNoSync

public void commitNoSync()
                  throws XmlException
End the transaction without flushing the log. This means the transaction will exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but it is possible that this transaction may be undone during recovery.

After this method has been called, regardless of its return, the XmlTransaction handle may not be accessed again. If this method encounters an error, the transaction and all child transactions of the transaction are aborted.

Throws:
XmlException

Berkeley DB XML
version 2.5.16

Copyright (c) 1996,2009 Oracle. All rights reserved.