Package org.teiid.jdbc
Class XAConnectionImpl
- java.lang.Object
-
- org.teiid.jdbc.XAConnectionImpl
-
- All Implemented Interfaces:
PooledConnection
,XAConnection
,XAResource
public class XAConnectionImpl extends Object implements XAConnection, XAResource
Implementation of XAConnection.
-
-
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
Constructors Constructor Description XAConnectionImpl(ConnectionImpl conn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectionEventListener(ConnectionEventListener listener)
void
addStatementEventListener(StatementEventListener arg0)
void
close()
void
commit(Xid xid, boolean onePhase)
void
end(Xid xid, int flag)
void
forget(Xid xid)
Connection
getConnection()
int
getTransactionTimeout()
XAResource
getXAResource()
boolean
isSameRM(XAResource arg0)
protected void
notifyListener(SQLException e)
Notify listeners, if there is any, about the connection status.int
prepare(Xid xid)
Xid[]
recover(int flag)
void
removeConnectionEventListener(ConnectionEventListener listener)
void
removeStatementEventListener(StatementEventListener arg0)
void
rollback(Xid xid)
boolean
setTransactionTimeout(int seconds)
void
start(Xid xid, int flag)
-
-
-
Constructor Detail
-
XAConnectionImpl
public XAConnectionImpl(ConnectionImpl conn)
-
-
Method Detail
-
getConnection
public Connection getConnection() throws SQLException
- Specified by:
getConnection
in interfacePooledConnection
- Throws:
SQLException
-
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener)
- Specified by:
addConnectionEventListener
in interfacePooledConnection
-
removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener listener)
- Specified by:
removeConnectionEventListener
in interfacePooledConnection
-
getXAResource
public XAResource getXAResource() throws SQLException
- Specified by:
getXAResource
in interfaceXAConnection
- Throws:
SQLException
-
close
public void close() throws SQLException
- Specified by:
close
in interfacePooledConnection
- Throws:
SQLException
-
notifyListener
protected void notifyListener(SQLException e)
Notify listeners, if there is any, about the connection status. If e is null, the connection is properly closed.- Parameters:
e
-
-
addStatementEventListener
public void addStatementEventListener(StatementEventListener arg0)
- Specified by:
addStatementEventListener
in interfacePooledConnection
-
removeStatementEventListener
public void removeStatementEventListener(StatementEventListener arg0)
- Specified by:
removeStatementEventListener
in interfacePooledConnection
-
commit
public void commit(Xid xid, boolean onePhase) throws XAException
- Specified by:
commit
in interfaceXAResource
- Throws:
XAException
-
end
public void end(Xid xid, int flag) throws XAException
- Specified by:
end
in interfaceXAResource
- Throws:
XAException
- See Also:
XAResource.end(javax.transaction.xa.Xid, int)
-
forget
public void forget(Xid xid) throws XAException
- Specified by:
forget
in interfaceXAResource
- Throws:
XAException
- See Also:
XAResource.forget(javax.transaction.xa.Xid)
-
getTransactionTimeout
public int getTransactionTimeout() throws XAException
- Specified by:
getTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
isSameRM
public boolean isSameRM(XAResource arg0) throws XAException
- Specified by:
isSameRM
in interfaceXAResource
- Throws:
XAException
-
prepare
public int prepare(Xid xid) throws XAException
- Specified by:
prepare
in interfaceXAResource
- Throws:
XAException
-
recover
public Xid[] recover(int flag) throws XAException
- Specified by:
recover
in interfaceXAResource
- Throws:
XAException
- See Also:
XAResource.recover(int)
-
rollback
public void rollback(Xid xid) throws XAException
- Specified by:
rollback
in interfaceXAResource
- Throws:
XAException
-
setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException
- Specified by:
setTransactionTimeout
in interfaceXAResource
- Throws:
XAException
-
start
public void start(Xid xid, int flag) throws XAException
- Specified by:
start
in interfaceXAResource
- Throws:
XAException
-
-