public class PGXAConnection extends PGPooledConnection implements XAConnection, XAResource
The PostgreSQL implementation of 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(BaseConnection conn) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit(Xid xid,
boolean onePhase) |
void |
end(Xid xid,
int flags)
Preconditions:
Flags is one of TMSUCCESS, TMFAIL, TMSUSPEND
xid !
|
void |
forget(Xid xid)
Does nothing, since we don't do heuristics.
|
Connection |
getConnection()
XAConnection interface.
|
int |
getTransactionTimeout()
We don't do transaction timeouts.
|
XAResource |
getXAResource() |
boolean |
isSameRM(XAResource xares) |
int |
prepare(Xid xid)
Prepares transaction.
|
Xid[] |
recover(int flag)
Recovers transaction.
|
void |
rollback(Xid xid)
Preconditions:
xid is known to the RM or it's in prepared state
Implementation deficiency preconditions:
xid must be associated with this connection if it's not in prepared state.
|
boolean |
setTransactionTimeout(int seconds)
We don't do transaction timeouts.
|
void |
start(Xid xid,
int flags)
Preconditions:
Flags must be one of TMNOFLAGS, TMRESUME or TMJOIN
xid !
|
addConnectionEventListener, addStatementEventListener, close, createConnectionEvent, removeConnectionEventListener, removeStatementEventListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConnectionEventListener, addStatementEventListener, close, removeConnectionEventListener, removeStatementEventListenerpublic PGXAConnection(BaseConnection conn) throws SQLException
SQLExceptionpublic Connection getConnection() throws SQLException
getConnection in interface PooledConnectiongetConnection in class PGPooledConnectionSQLExceptionpublic XAResource getXAResource()
getXAResource in interface XAConnectionpublic void start(Xid xid, int flags) throws XAException
Preconditions:
Implementation deficiency preconditions:
Postconditions:
start in interface XAResourceXAExceptionpublic void end(Xid xid, int flags) throws XAException
Preconditions:
Implementation deficiency preconditions:
Postconditions:
end in interface XAResourceXAExceptionpublic int prepare(Xid xid) throws XAException
Prepares transaction. Preconditions:
Implementation deficiency preconditions:
Postconditions:
prepare in interface XAResourceXAExceptionpublic Xid[] recover(int flag) throws XAException
Recovers transaction. Preconditions:
Postconditions:
recover in interface XAResourceXAExceptionpublic void rollback(Xid xid) throws XAException
Preconditions:
Implementation deficiency preconditions:
Postconditions:
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 © 1997-2020 PostgreSQL Global Development Group. All Rights Reserved.