public class PGXAConnection extends PGPooledConnection implements XAConnection, XAResource
XAConnection and XAResource.
This implementation doesn't support transaction interleaving
(see JTA specification, section 3.4.4) and suspend/resume.
Two-phase commit requires PostgreSQL server version 8.1
or higher.TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY| Constructor and Description |
|---|
PGXAConnection(PGConnectionImpl conn) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(Xid xid,
boolean onePhase) |
void |
end(Xid xid,
int flags)
Preconditions:
1.
|
void |
forget(Xid xid)
Does nothing, since we don't do heuristics,
|
Connection |
getConnection()
Gets a handle for a client to use.
|
int |
getTransactionTimeout()
We don't do transaction timeouts.
|
XAResource |
getXAResource() |
boolean |
isSameRM(XAResource xares) |
int |
prepare(Xid xid)
Preconditions:
1.
|
Xid[] |
recover(int flag)
Preconditions:
1.
|
void |
rollback(Xid xid)
Preconditions:
1.
|
boolean |
setTransactionTimeout(int seconds)
We don't do transaction timeouts.
|
void |
start(Xid xid,
int flags)
Preconditions:
1.
|
addConnectionEventListener, addStatementEventListener, close, createConnectionEvent, createStatementEvent, fireConnectionError, removeConnectionEventListener, removeStatementEventListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConnectionEventListener, addStatementEventListener, close, removeConnectionEventListener, removeStatementEventListenerpublic PGXAConnection(PGConnectionImpl conn) throws SQLException
SQLExceptionpublic Connection getConnection() throws SQLException
PGPooledConnectionAccording to the JDBC 2.0 Optional Package spec (6.2.3), only one client may have an active handle to the connection at a time, so if there is a previous handle active when this is called, the previous one is forcibly closed and its work rolled back.
getConnection in interface PooledConnectiongetConnection in class PGPooledConnectionSQLExceptionpublic XAResource getXAResource()
getXAResource in interface XAConnectionpublic void start(Xid xid, int flags) throws XAException
start in interface XAResourceXAExceptionpublic void end(Xid xid, int flags) throws XAException
end in interface XAResourceXAExceptionpublic int prepare(Xid xid) throws XAException
prepare in interface XAResourceXAExceptionpublic Xid[] recover(int flag) throws XAException
recover in interface XAResourceXAExceptionpublic void rollback(Xid xid) throws XAException
rollback in interface XAResourceXAExceptionpublic void commit(Xid xid, boolean onePhase) throws XAException
commit in interface XAResourceXAExceptionpublic boolean isSameRM(XAResource xares) throws XAException
isSameRM in interface XAResourceXAExceptionpublic void forget(Xid xid) throws XAException
forget in interface XAResourceXAExceptionpublic int getTransactionTimeout()
getTransactionTimeout in interface XAResourcepublic boolean setTransactionTimeout(int seconds)
setTransactionTimeout in interface XAResourceCopyright © 2013–2017 impossibl.com. All rights reserved.