|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.jdbc_xa.XAResourceImpl
This is the implementation of the XAResource interface for our pseudo JDBC-XA driver. This object is used to demarcate the transactions and associate an XID to the SQL requests (start-end). Actually, no real 2PC is done here because the std JDBC driver do not support a java XA interface for it (only commit/rollback but no prepare!) So we choose to return always OK at prepare. The goal is more to offer a standard JDBC-XA interface to the EJB Container than to achieve a real distributed 2PC. Anyway, when database vendors will offer real JDBC-XA drivers, the JOnAS Server will be OK without any change.
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 | |
XAResourceImpl(org.objectweb.jonas.jdbc_xa.XAConnectionImpl xac,
java.sql.Connection actual,
XADataSourceImpl ds)
Build an instance. |
Method Summary | |
void |
commit(javax.transaction.xa.Xid xid,
boolean onePhase)
Commit the global transaction specified by xid. |
void |
end(javax.transaction.xa.Xid xid,
int flags)
Ends the work performed on behalf of a transaction branch. |
void |
forget(javax.transaction.xa.Xid xid)
Tell the resource manager to forget about a heuristically completed transaction branch. |
java.lang.String |
getRMID()
|
int |
getTransactionTimeout()
Obtain the current transaction timeout value set for this XAResource instance. |
boolean |
isSameRM(javax.transaction.xa.XAResource xares)
Determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares |
int |
prepare(javax.transaction.xa.Xid xid)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid. |
javax.transaction.xa.Xid[] |
recover(int flag)
Obtain a list of prepared transaction branches from a resource manager. |
void |
rollback(javax.transaction.xa.Xid xid)
Inform the resource manager to roll back work done on behalf of a transaction branch |
boolean |
setTransactionTimeout(int seconds)
Set the current transaction timeout value for this XAResource instance. |
void |
start(javax.transaction.xa.Xid xid,
int flags)
Start work on behalf of a transaction branch specified in xid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XAResourceImpl(org.objectweb.jonas.jdbc_xa.XAConnectionImpl xac, java.sql.Connection actual, XADataSourceImpl ds)
xac
- associated XAConnectionactual
- underlying database connectionds
- the XADataSourceMethod Detail |
public void commit(javax.transaction.xa.Xid xid, boolean onePhase) throws javax.transaction.xa.XAException
commit
in interface javax.transaction.xa.XAResource
xid
- transaction xidonePhase
- true if one phase commit
javax.transaction.xa.XAException
- XA protocol errorpublic void end(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
end
in interface javax.transaction.xa.XAResource
xid
- transaction xidflags
- currently unused
javax.transaction.xa.XAException
- XA protocol errorpublic void forget(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
forget
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic int getTransactionTimeout() throws javax.transaction.xa.XAException
getTransactionTimeout
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- XA protocol errorpublic boolean isSameRM(javax.transaction.xa.XAResource xares) throws javax.transaction.xa.XAException
isSameRM
in interface javax.transaction.xa.XAResource
xares
- An XAResource object
javax.transaction.xa.XAException
- XA protocol errorpublic int prepare(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
prepare
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic javax.transaction.xa.Xid[] recover(int flag) throws javax.transaction.xa.XAException
recover
in interface javax.transaction.xa.XAResource
javax.transaction.xa.XAException
- XA protocol errorpublic void rollback(javax.transaction.xa.Xid xid) throws javax.transaction.xa.XAException
rollback
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic boolean setTransactionTimeout(int seconds) throws javax.transaction.xa.XAException
setTransactionTimeout
in interface javax.transaction.xa.XAResource
seconds
- timeout value, in seconds.
javax.transaction.xa.XAException
- XA protocol errorpublic void start(javax.transaction.xa.Xid xid, int flags) throws javax.transaction.xa.XAException
start
in interface javax.transaction.xa.XAResource
xid
- transaction xid
javax.transaction.xa.XAException
- XA protocol errorpublic java.lang.String getRMID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |