public class PGXAConnection extends PGPooledConnection implements XAConnection, XAResource
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: 1.
|
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)
Preconditions: 1. xid !
|
Xid[] |
recover(int flag)
Preconditions: 1. flag must be one of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS or TMSTARTTRSCAN |
TMENDRSCAN 2. if flag isn't TMSTARTRSCAN or TMSTARTRSCAN | TMENDRSCAN, a recovery scan must be
in progress
Postconditions: 1. list of prepared xids is returned
|
void |
rollback(Xid xid)
Preconditions: 1. xid is known to the RM or it's in prepared state
Implementation deficiency preconditions: 1. 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: 1. flags must be one of TMNOFLAGS, TMRESUME or TMJOIN 2. xid !
|
addConnectionEventListener, addStatementEventListener, close, createConnectionEvent, getParentLogger, removeConnectionEventListener, removeStatementEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addConnectionEventListener, addStatementEventListener, close, removeConnectionEventListener, removeStatementEventListener
public PGXAConnection(BaseConnection conn) throws SQLException
SQLException
public Connection getConnection() throws SQLException
getConnection
in interface PooledConnection
getConnection
in class PGPooledConnection
SQLException
public XAResource getXAResource()
getXAResource
in interface XAConnection
public void start(Xid xid, int flags) throws XAException
start
in interface XAResource
XAException
public void end(Xid xid, int flags) throws XAException
end
in interface XAResource
XAException
public int prepare(Xid xid) throws XAException
prepare
in interface XAResource
XAException
public Xid[] recover(int flag) throws XAException
recover
in interface XAResource
XAException
public void rollback(Xid xid) throws XAException
rollback
in interface XAResource
XAException
public void commit(Xid xid, boolean onePhase) throws XAException
commit
in interface XAResource
XAException
public boolean isSameRM(XAResource xares) throws XAException
isSameRM
in interface XAResource
XAException
public void forget(Xid xid) throws XAException
forget
in interface XAResource
XAException
public int getTransactionTimeout()
getTransactionTimeout
in interface XAResource
public boolean setTransactionTimeout(int seconds)
setTransactionTimeout
in interface XAResource
Copyright © 2016 PostgreSQL Global Development Group. All rights reserved.