Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je
Class XAEnvironment

java.lang.Object
  extended by com.sleepycat.je.Environment
      extended by com.sleepycat.je.XAEnvironment
All Implemented Interfaces:
Closeable, XAResource

public class XAEnvironment
extends Environment
implements XAResource

An Environment that implements XAResource. If JE is used in an XA environment, this class should be used instead of Environment so that appropriate XA functions are available.


Field Summary
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
XAEnvironment(File envHome, EnvironmentConfig configuration)
          Create a database environment handle.
 
Method Summary
 void commit(Xid xid, boolean ignore)
           
 void end(Xid xid, int flags)
           
 void forget(Xid xid)
           
 int getTransactionTimeout()
           
 boolean isSameRM(XAResource rm)
           
 int prepare(Xid xid)
           
 Xid[] recover(int flags)
           
 void rollback(Xid xid)
           
 boolean setTransactionTimeout(int timeout)
           
 void start(Xid xid, int flags)
           
 
Methods inherited from class com.sleepycat.je.Environment
beginTransaction, checkpoint, cleanLog, close, compress, evictMemory, flushLog, getConfig, getDatabaseNames, getHome, getLockStats, getMutableConfig, getStats, getThreadTransaction, getTransactionStats, isInternalHandle, isValid, openDatabase, openSecondaryDatabase, preload, printStartupInfo, removeDatabase, renameDatabase, setMutableConfig, setThreadTransaction, sync, truncateDatabase, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAEnvironment

public XAEnvironment(File envHome,
                     EnvironmentConfig configuration)
              throws EnvironmentNotFoundException,
                     EnvironmentLockedException
Create a database environment handle.

Parameters:
envHome - The database environment's home directory.
configuration - The database environment attributes. If null, default attributes are used.
Throws:
EnvironmentNotFoundException
EnvironmentLockedException
Method Detail

commit

public void commit(Xid xid,
                   boolean ignore)
            throws XAException
Specified by:
commit in interface XAResource
Throws:
XAException

end

public void end(Xid xid,
                int flags)
         throws XAException
Specified by:
end in interface XAResource
Throws:
XAException

forget

public void forget(Xid xid)
            throws XAException
Specified by:
forget in interface XAResource
Throws:
XAException

isSameRM

public boolean isSameRM(XAResource rm)
                 throws XAException
Specified by:
isSameRM in interface XAResource
Throws:
XAException

prepare

public int prepare(Xid xid)
            throws XAException
Specified by:
prepare in interface XAResource
Throws:
XAException

recover

public Xid[] recover(int flags)
              throws XAException
Specified by:
recover in interface XAResource
Throws:
XAException

rollback

public void rollback(Xid xid)
              throws XAException
Specified by:
rollback in interface XAResource
Throws:
XAException

getTransactionTimeout

public int getTransactionTimeout()
                          throws XAException
Specified by:
getTransactionTimeout in interface XAResource
Throws:
XAException

setTransactionTimeout

public boolean setTransactionTimeout(int timeout)
Specified by:
setTransactionTimeout in interface XAResource

start

public void start(Xid xid,
                  int flags)
           throws XAException
Specified by:
start in interface XAResource
Throws:
XAException

Berkeley DB Java Edition
version 5.0.34

Copyright (c) 2004-2011 Oracle. All rights reserved.