|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.idms.io.TraceObject ca.idms.jdbc.IdmsJdbcObject ca.idms.jdbc.IdmsPooledConnection ca.idms.jdbc.IdmsXAConnection
public class IdmsXAConnection
IDMS two phase connection.
Field Summary |
---|
Fields inherited from class ca.idms.jdbc.IdmsJdbcObject |
---|
FAKE_METHODS, FAKE_SUPPORT, fakeSupport, MESSAGES |
Fields inherited from class ca.idms.io.TraceObject |
---|
exclude, EXCLUDE, FALSE, include, INCLUDE, logWriter, PREFIX, PROPERTIES_FILE, PROPERTIES_KEY, snap, SNAP, SNAP_BYTES, SNAP_NATIVE, SNAP_OBJECT, SNAP_SQL, snapBytes, snapNative, snapObject, snapSql, stub, trace, TRACE, TRACE_FILE, TRACE_LIFE, TRACE_NATIVE, TRACE_PRODUCT, traceLife, traceNative, traceStream, TRUE |
Fields inherited from interface ca.idms.qcli.SQLState |
---|
SQL_00000, SQL_01000, SQL_01004, SQL_07001, SQL_07009, SQL_08001, SQL_08002, SQL_08003, SQL_08004, SQL_08006, SQL_08007, SQL_0A000, SQL_21000, SQL_22000, SQL_22001, SQL_22003, SQL_22005, SQL_22007, SQL_24000, SQL_25000, SQL_3C000, SQL_40000, SQL_42000, SQL_HY000, SQL_HY004, SQL_HY009, SQL_HY010, SQL_HY024, SQL_HY106, SQL_HYC00 |
Method Summary | |
---|---|
void |
close()
Removes reference to the XAResource and closes the PooledConnection. |
void |
connectionErrorOccurred(javax.transaction.xa.XAException e)
Notifies ConnectionEvent listeners that a connection error has occurred. |
NativeMessage |
createNativeMessage()
Creates the native message buffer for start and end. |
ca.idms.dsi.Sqlsid |
getSessionId()
Gets the current DSI session id. |
javax.transaction.xa.XAResource |
getXAResource()
|
boolean |
isStartAllowed()
Checks if start is allowed. |
void |
notifyError(java.sql.SQLException ex,
int rc)
Overrides IdmsPooledConnection.notifyError(java.sql.SQLException, int) . |
void |
transactionEnded(ca.idms.dsi.Sqlsid sid,
int flags)
Sets the current session to the local transaction. |
void |
transactionStarted(ca.idms.dsi.Sqlsid sid,
int flags)
Sets the current session to the global transaction. |
Methods inherited from class ca.idms.jdbc.IdmsPooledConnection |
---|
addConnectionEventListener, addStatementEventListener, get, getConnection, notifyClosed, notifyStatementClosed, notifyStatementError, removeConnectionEventListener, removeStatementEventListener |
Methods inherited from class ca.idms.jdbc.IdmsJdbcObject |
---|
clearWarnings, getWarnings, hasCursor, hasUpdate, isStarted, isSuspended, isWrapperFor, notifyStatementError, unwrap |
Methods inherited from class ca.idms.io.TraceObject |
---|
finalize, getBoolean, getClasses, getInteger, getProperty, listProperties, message, parseList, print, print, print, println, println, snap, snap, snap, snap, snap, snap, snap, toHex, toHex, toHex, toHex, toHex, toString, trace, trace, trace, trace, trace, trace, traceEntry, unloadProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.sql.PooledConnection |
---|
addConnectionEventListener, addStatementEventListener, getConnection, removeConnectionEventListener, removeStatementEventListener |
Method Detail |
---|
public javax.transaction.xa.XAResource getXAResource() throws java.sql.SQLException
getXAResource
in interface javax.sql.XAConnection
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface javax.sql.PooledConnection
close
in class IdmsPooledConnection
java.sql.SQLException
- (not really)public void notifyError(java.sql.SQLException ex, int rc)
IdmsPooledConnection.notifyError(java.sql.SQLException, int)
.
Closes the IdmsXAResource and notifies listeners that
a connection error has occurred.
notifyError
in class IdmsPooledConnection
ex
- SQLException that will be thrown to the applicationrc
- QcliException reason code or 0 if an IOExceptionIdmsPooledConnection.notifyError(java.sql.SQLException, int)
public NativeMessage createNativeMessage()
createNativeMessage
in interface ca.idms.xa.IdmsXAListener
public ca.idms.dsi.Sqlsid getSessionId()
getSessionId
in interface ca.idms.xa.IdmsXAListener
public boolean isStartAllowed()
isStartAllowed
in interface ca.idms.xa.IdmsXAListener
IdmsXAResource.start(javax.transaction.xa.Xid, int)
.
This methods checks that the current session is the local
transaction and that there are no pending updates.public void transactionStarted(ca.idms.dsi.Sqlsid sid, int flags) throws javax.transaction.xa.XAException
IdmsXAResource.start(javax.transaction.xa.Xid, int)
.
If flags contains TMRESUME the session is retrieved from
the suspended sessions table, otherwise a new IdmsSession
object is created. In either case the session will be set for
the connection and all existing Statement obects.
transactionStarted
in interface ca.idms.xa.IdmsXAListener
sid
- SQL session identifier returned from XCLI.flags
- XAResource.end flags
javax.transaction.xa.XAException
- if suspended session not found for TMRESUMEpublic void transactionEnded(ca.idms.dsi.Sqlsid sid, int flags) throws javax.transaction.xa.XAException
IdmsXAResource.end(javax.transaction.xa.Xid, int)
.
If flags contains TMRSUSPEND the session is saved in the
suspended sessions table. The local transaction session
is set for the connection and all existing Statement obects.
transactionEnded
in interface ca.idms.xa.IdmsXAListener
sid
- SQL session identifier returned from XCLI.flags
- XAResource.end flags
javax.transaction.xa.XAException
- if XCLI did not return the local sessionpublic void connectionErrorOccurred(javax.transaction.xa.XAException e)
IdmsXAResource
object invokes this method when a connection
error occurs while processing a XA request. Since the connection is
no longer usable, the current session is not changed.
connectionErrorOccurred
in interface ca.idms.xa.IdmsXAListener
e
- the XAException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |