org.enhydra.jdbc.instantdb
Class IdbXAConnection
java.lang.Object
org.enhydra.jdbc.standard.StandardPooledConnection
org.enhydra.jdbc.standard.StandardXAConnection
org.enhydra.jdbc.instantdb.IdbXAConnection
- All Implemented Interfaces:
- Runnable, Referenceable, PooledConnection, XAConnection, XAResource
public final class IdbXAConnection
- extends StandardXAConnection
Provides and InstantDB specific instance of StandardXAConnection. Almost all of
the required functionality is provided curtesy of the generic super class
which looks after most of the transaction state management. InstantDB's
own Transaction object is informed that it is part of a global transaction
and looks after the detail thereafter.
| Fields inherited from interface javax.transaction.xa.XAResource |
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY |
|
Method Summary |
boolean |
isSameRM(XAResource xares)
Checks to see if two XAResource objects correspond to the
same Resource Manager. |
int |
prepare(Xid xid)
Prepares to perform a commit. |
void |
start(Xid xid,
int flags)
Associates this XAConnection with a global transaction. |
| Methods inherited from class org.enhydra.jdbc.standard.StandardXAConnection |
checkPreparedState, close, commit, doStart, end, forget, getCommitOnPrepare, getConnection, getReference, getTransactionTimeout, getXAResource, newConnectionHandle, recover, rollback, run, setCommitOnPrepare, setTransactionManager, setTransactionTimeout, toString |
IdbXAConnection
public IdbXAConnection(StandardXADataSource dataSource,
String user,
String password)
throws SQLException
- Creates the first free connection.
- Throws:
SQLException
start
public void start(Xid xid,
int flags)
throws XAException
- Associates this XAConnection with a global transaction. This
is the only method which can associate the current connection
with a global transaction. It acts only on the current
connection which must have been previously established using
getConnection.
- Specified by:
start in interface XAResource- Overrides:
start in class StandardXAConnection
- Throws:
XAException
prepare
public int prepare(Xid xid)
throws XAException
- Prepares to perform a commit.
- Specified by:
prepare in interface XAResource- Overrides:
prepare in class StandardXAConnection
- Throws:
XAException
isSameRM
public boolean isSameRM(XAResource xares)
throws XAException
- Checks to see if two XAResource objects correspond to the
same Resource Manager. This can go one better than its
super class as it can actually check the InstantDB database
objects.
- Specified by:
isSameRM in interface XAResource- Overrides:
isSameRM in class StandardXAConnection
- Throws:
XAException
Copyright © 2011. All Rights Reserved.