org.enhydra.jdbc.oracle
Class OracleXAConnection

java.lang.Object
  extended byorg.enhydra.jdbc.standard.StandardPooledConnection
      extended byorg.enhydra.jdbc.standard.StandardXAConnection
          extended byorg.enhydra.jdbc.oracle.OracleXAConnection
All Implemented Interfaces:
javax.sql.PooledConnection, javax.naming.Referenceable, java.lang.Runnable, javax.sql.XAConnection, javax.transaction.xa.XAResource

public final class OracleXAConnection
extends StandardXAConnection

Provides an Oracle 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. Oracle's own resource manager is informed that it is part of a global transaction and looks after the detail thereafter.


Field Summary
 
Fields inherited from class org.enhydra.jdbc.standard.StandardXAConnection
connectionHandle, curCon, thisAutoCommit, timerThread, transactionManager, xaDataSource
 
Fields inherited from class org.enhydra.jdbc.standard.StandardPooledConnection
con, dataSource, log
 
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY
 
Constructor Summary
OracleXAConnection(StandardXADataSource dataSource, java.lang.String user, java.lang.String password)
          Creates the first free connection.
 
Method Summary
 void commit(javax.transaction.xa.Xid xid, boolean flag)
          Performs a commit on this resource manager's branch of the global transaction.
 void end(javax.transaction.xa.Xid xid, int flags)
          Ends a connection's association with a global transaction.
 void forget(javax.transaction.xa.Xid xid)
          This is called by a TM when the RM has reported a heuristic completion.
 boolean isSameRM(javax.transaction.xa.XAResource res)
           
 int prepare(javax.transaction.xa.Xid xid)
          Prepares to perform a commit.
 void rollback(javax.transaction.xa.Xid xid)
          Performs a rollback on this resource manager's branch of the global transaction.
 void start(javax.transaction.xa.Xid xid, int flags)
          Associates this XAConnection with a global transaction.
 
Methods inherited from class org.enhydra.jdbc.standard.StandardXAConnection
checkPreparedState, close, doStart, getCommitOnPrepare, getConnection, getReference, getTransactionTimeout, getXAResource, newConnectionHandle, recover, run, setCommitOnPrepare, setTransactionManager, setTransactionTimeout, toString
 
Methods inherited from class org.enhydra.jdbc.standard.StandardPooledConnection
addConnectionEventListener, connectionErrorOccurred, getPhysicalConnection, removeConnectionEventListener, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.sql.PooledConnection
addConnectionEventListener, removeConnectionEventListener
 

Constructor Detail

OracleXAConnection

public OracleXAConnection(StandardXADataSource dataSource,
                          java.lang.String user,
                          java.lang.String password)
                   throws java.sql.SQLException
Creates the first free connection.

Method Detail

commit

public void commit(javax.transaction.xa.Xid xid,
                   boolean flag)
            throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
Performs a commit on this resource manager's branch of the global transaction.

Specified by:
commit in interface javax.transaction.xa.XAResource
Overrides:
commit in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

end

public void end(javax.transaction.xa.Xid xid,
                int flags)
         throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
Ends a connection's association with a global transaction.

It need not act on the current transaction. There is an interval between being returned to the pool manager and being invoked by the transaction manager during which the current connection can change.

Note that the only effect is to change the connection state.

Specified by:
end in interface javax.transaction.xa.XAResource
Overrides:
end in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

forget

public void forget(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
This is called by a TM when the RM has reported a heuristic completion. It must retain the transaction context until told to forget about it.

Specified by:
forget in interface javax.transaction.xa.XAResource
Overrides:
forget in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

prepare

public int prepare(javax.transaction.xa.Xid xid)
            throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
Prepares to perform a commit. May actually perform a commit in the flag commitOnPrepare is set to true.

Specified by:
prepare in interface javax.transaction.xa.XAResource
Overrides:
prepare in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

rollback

public void rollback(javax.transaction.xa.Xid xid)
              throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
Performs a rollback on this resource manager's branch of the global transaction.

Specified by:
rollback in interface javax.transaction.xa.XAResource
Overrides:
rollback in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

start

public void start(javax.transaction.xa.Xid xid,
                  int flags)
           throws javax.transaction.xa.XAException
Description copied from class: StandardXAConnection
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 javax.transaction.xa.XAResource
Overrides:
start in class StandardXAConnection
Throws:
javax.transaction.xa.XAException

isSameRM

public boolean isSameRM(javax.transaction.xa.XAResource res)
                 throws javax.transaction.xa.XAException
Specified by:
isSameRM in interface javax.transaction.xa.XAResource
Overrides:
isSameRM in class StandardXAConnection
Throws:
javax.transaction.xa.XAException