org.objectweb.jonas.jdbc_xa.XAResourceImpl Class Reference

Collaboration diagram for org.objectweb.jonas.jdbc_xa.XAResourceImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XAResourceImpl (XAConnectionImpl xac, Connection actual, XADataSourceImpl ds)
synchronized void commit (Xid xid, boolean onePhase) throws XAException
synchronized void end (Xid xid, int flags) throws XAException
synchronized void forget (Xid xid) throws XAException
synchronized int getTransactionTimeout () throws XAException
boolean isSameRM (XAResource xares) throws XAException
synchronized int prepare (Xid xid) throws XAException
synchronized Xid[] recover (int flag) throws XAException
synchronized void rollback (Xid xid) throws XAException
synchronized boolean setTransactionTimeout (int seconds) throws XAException
synchronized void start (Xid xid, int flags) throws XAException

Detailed Description

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.
Author:
Philippe Durieux Contributor(s):

Definition at line 49 of file XAResourceImpl.java.


Constructor & Destructor Documentation

org.objectweb.jonas.jdbc_xa.XAResourceImpl.XAResourceImpl XAConnectionImpl  xac,
Connection  actual,
XADataSourceImpl  ds
 

Build an instance.

Parameters:
xac associated XAConnection
actual underlying database connection
ds the XADataSource

Definition at line 70 of file XAResourceImpl.java.

References org.objectweb.jonas.jdbc_xa.XAConnectionImpl.actConn, org.objectweb.jonas.jdbc_xa.XADataSourceImpl.getDataSourceName(), and org.objectweb.jonas.jdbc_xa.XADataSourceImpl.log.

Here is the call graph for this function:


Member Function Documentation

synchronized void org.objectweb.jonas.jdbc_xa.XAResourceImpl.commit Xid  xid,
boolean  onePhase
throws XAException
 

Commit the global transaction specified by xid.

Parameters:
xid transaction xid
onePhase true if one phase commit
Exceptions:
XAException XA protocol error

Definition at line 88 of file XAResourceImpl.java.

References org.objectweb.jonas.jdbc_xa.XADataSourceImpl.log, and org.objectweb.jonas.jdbc_xa.XAConnectionImpl.notifyError().

Here is the call graph for this function:

synchronized void org.objectweb.jonas.jdbc_xa.XAResourceImpl.end Xid  xid,
int  flags
throws XAException
 

Ends the work performed on behalf of a transaction branch.

Parameters:
xid transaction xid
flags currently unused
Exceptions:
XAException XA protocol error

Definition at line 127 of file XAResourceImpl.java.

synchronized void org.objectweb.jonas.jdbc_xa.XAResourceImpl.forget Xid  xid  )  throws XAException
 

Tell the resource manager to forget about a heuristically completed transaction branch.

Parameters:
xid transaction xid
Exceptions:
XAException XA protocol error

Definition at line 147 of file XAResourceImpl.java.

synchronized int org.objectweb.jonas.jdbc_xa.XAResourceImpl.getTransactionTimeout  )  throws XAException
 

Obtain the current transaction timeout value set for this XAResource instance.

Returns:
the current transaction timeout in seconds
Exceptions:
XAException XA protocol error

Definition at line 161 of file XAResourceImpl.java.

boolean org.objectweb.jonas.jdbc_xa.XAResourceImpl.isSameRM XAResource  xares  )  throws XAException
 

Determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares

Parameters:
xares An XAResource object
Returns:
True if same RM instance, otherwise false.
Exceptions:
XAException XA protocol error

Definition at line 173 of file XAResourceImpl.java.

synchronized int org.objectweb.jonas.jdbc_xa.XAResourceImpl.prepare Xid  xid  )  throws XAException
 

Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.

Parameters:
xid transaction xid
Exceptions:
XAException XA protocol error

Definition at line 196 of file XAResourceImpl.java.

synchronized Xid [] org.objectweb.jonas.jdbc_xa.XAResourceImpl.recover int  flag  )  throws XAException
 

Obtain a list of prepared transaction branches from a resource manager.

Returns:
an array of transaction Xids
Exceptions:
XAException XA protocol error

Definition at line 210 of file XAResourceImpl.java.

synchronized void org.objectweb.jonas.jdbc_xa.XAResourceImpl.rollback Xid  xid  )  throws XAException
 

Inform the resource manager to roll back work done on behalf of a transaction branch

Parameters:
xid transaction xid
Exceptions:
XAException XA protocol error

Definition at line 223 of file XAResourceImpl.java.

References org.objectweb.jonas.jdbc_xa.XAConnectionImpl.notifyError().

Here is the call graph for this function:

synchronized boolean org.objectweb.jonas.jdbc_xa.XAResourceImpl.setTransactionTimeout int  seconds  )  throws XAException
 

Set the current transaction timeout value for this XAResource instance.

Parameters:
seconds timeout value, in seconds.
Returns:
always true
Exceptions:
XAException XA protocol error

Definition at line 274 of file XAResourceImpl.java.

synchronized void org.objectweb.jonas.jdbc_xa.XAResourceImpl.start Xid  xid,
int  flags
throws XAException
 

Start work on behalf of a transaction branch specified in xid

Parameters:
xid transaction xid
Exceptions:
XAException XA protocol error

Definition at line 286 of file XAResourceImpl.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:57 2005 for JOnAS by  doxygen 1.3.9.1