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.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final BaseConnection | conn
Underlying physical database connection. |
| private @Nullable Xid | |
| private boolean | |
| private static final Logger | |
| private @Nullable Xid | |
| private PGXAConnection. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | commit(Xid
A global transaction identifier xid, boolean If true, the resource manager should use a one-phase
commit protocol to commit the work done on behalf of xid. onePhase)Implements javax. Commits the global transaction specified by xid. |
| private void | |
| private void | |
| private void | |
| public void | end(Xid
A global transaction identifier that is the same as
the identifier used previously in the xid, int start method.One of TMSUCCESS, TMFAIL, or TMSUSPEND. flags)Implements javax. Preconditions:
|
| public void | forget(Xid
A global transaction identifier. xid)Implements javax. Does nothing, since we don't do heuristics. |
| public Connection | getConnection()
Overrides org. Implements javax. XAConnection interface. |
| public int | getTransactionTimeout()
Implements javax. We don't do transaction timeouts. |
| public XAResource | getXAResource()
Implements javax. Retrieves an |
| private boolean | |
| public boolean | isSameRM(XAResource
An XAResource object whose resource manager instance
is to be compared with the resource manager instance of the
target object. xares)Implements javax. This method is called to determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares. |
| private int | |
| public int | prepare(Xid
A global transaction identifier. xid)Implements javax. Prepares transaction. |
| public Xid[] | recover(int
One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
must be used when no other flags are set in the parameter. flag)Implements javax. Recovers transaction. |
| public void | rollback(Xid
A global transaction identifier. xid)Implements javax. Preconditions:
|
| public boolean | setTransactionTimeout(int
The transaction timeout value in seconds. seconds)Implements javax. We don't do transaction timeouts. |
| public void | start(Xid
A global transaction identifier to be associated
with the resource. xid, int One of TMNOFLAGS, TMJOIN, or TMRESUME. flags)Implements javax. Preconditions:
|
| committedOrRolledBack | back to summary |
|---|---|
| private boolean committedOrRolledBack | |
| conn | back to summary |
|---|---|
| private final BaseConnection conn Underlying physical database connection. It's used for issuing PREPARE TRANSACTION/ COMMIT PREPARED/ROLLBACK PREPARED commands. | |
| currentXid | back to summary |
|---|---|
| private @Nullable Xid currentXid | |
| localAutoCommitMode | back to summary |
|---|---|
| private boolean localAutoCommitMode | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| preparedXid | back to summary |
|---|---|
| private @Nullable Xid preparedXid | |
| state | back to summary |
|---|---|
| private PGXAConnection. | |
| PGXAConnection | back to summary |
|---|---|
| public PGXAConnection(BaseConnection conn) throws SQLException | |
| commit | back to summary |
|---|---|
| public void commit(Xid xid, boolean onePhase) throws XAException Implements javax. Doc from javax. Commits the global transaction specified by xid.
| |
| commitOnePhase | back to summary |
|---|---|
| private void commitOnePhase(Xid xid) throws XAException Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| commitPrepared | back to summary |
|---|---|
| private void commitPrepared(Xid xid) throws XAException Commits prepared transaction. Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| debug | back to summary |
|---|---|
| private void debug(String s) | |
| end | back to summary |
|---|---|
| public void end(Xid xid, int flags) throws XAException Implements javax. Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| forget | back to summary |
|---|---|
| public void forget(Xid xid) throws XAException Implements javax. Does nothing, since we don't do heuristics.
| |
| getConnection | back to summary |
|---|---|
| public Connection getConnection() throws SQLException Overrides org. Implements javax. XAConnection interface.
| |
| getTransactionTimeout | back to summary |
|---|---|
| public int getTransactionTimeout() Implements javax. We don't do transaction timeouts. Just returns 0.
| |
| getXAResource | back to summary |
|---|---|
| public XAResource getXAResource() Implements javax. Doc from javax. Retrieves an
| |
| isPostgreSQLIntegrityConstraintViolation | back to summary |
|---|---|
| private boolean isPostgreSQLIntegrityConstraintViolation(SQLException sqlException) | |
| isSameRM | back to summary |
|---|---|
| public boolean isSameRM(XAResource xares) throws XAException Implements javax. Doc from javax. This method is called to determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares.
| |
| mapSQLStateToXAErrorCode | back to summary |
|---|---|
| private int mapSQLStateToXAErrorCode(SQLException sqlException) | |
| prepare | back to summary |
|---|---|
| public int prepare(Xid xid) throws XAException Implements javax. Prepares transaction. Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| recover | back to summary |
|---|---|
| public Xid[] recover(int flag) throws XAException Implements javax. Recovers transaction. Preconditions:
Postconditions:
| |
| rollback | back to summary |
|---|---|
| public void rollback(Xid xid) throws XAException Implements javax. Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| setTransactionTimeout | back to summary |
|---|---|
| public boolean setTransactionTimeout(int seconds) Implements javax. We don't do transaction timeouts. Returns false.
| |
| start | back to summary |
|---|---|
| public void start(Xid xid, int flags) throws XAException Implements javax. Preconditions:
Implementation deficiency preconditions:
Postconditions:
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Connection |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public @Nullable Object | invoke(Object
the proxy instance that the method was invoked on proxy, Method the method, @Nullable Object[] Method instance corresponding to
the interface method invoked on the proxy instance. The declaring
class of the Method object will be the interface that
the method was declared in, which may be a superinterface of the
proxy interface that the proxy class inherits the method through.an array of objects containing the values of the
arguments passed in the method invocation on the proxy instance,
or args)null if interface method takes no arguments.
Arguments of primitive types are wrapped in instances of the
appropriate primitive wrapper class, such as
java.lang.Integer or java.lang.Boolean.Implements java. Processes a method invocation on a proxy instance and returns the result. |
| con | back to summary |
|---|---|
| private final Connection con | |
| ConnectionHandler | back to summary |
|---|---|
| pack-priv ConnectionHandler(Connection con) | |
| invoke | back to summary |
|---|---|
| public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable Implements java. Doc from java. Processes a method invocation on a proxy instance and returns the result. This method will be invoked on an invocation handler when a method is invoked on a proxy instance that it is associated with.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final PGXAConnection. | ACTIVE
|
| public static final PGXAConnection. | ENDED
|
| public static final PGXAConnection. | IDLE
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static PGXAConnection. | |
| public static PGXAConnection. |
| ACTIVE | back to summary |
|---|---|
| public static final PGXAConnection.
| |
| ENDED | back to summary |
|---|---|
| public static final PGXAConnection.
| |
| IDLE | back to summary |
|---|---|
| public static final PGXAConnection.
| |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static PGXAConnection. | |
| values | back to summary |
|---|---|
| public static PGXAConnection. | |