パッケージ org.postgresql.xa

クラス PGXAConnection

java.lang.Object
org.postgresql.ds.PGPooledConnection
org.postgresql.xa.PGXAConnection
すべての実装されたインタフェース:
PooledConnection, XAConnection, XAResource

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.

  • コンストラクタの詳細

  • メソッドの詳細

    • getConnection

      public Connection getConnection() throws SQLException
      XAConnection interface.
      定義:
      getConnection インタフェース内 PooledConnection
      オーバーライド:
      getConnection クラス内 PGPooledConnection
      例外:
      SQLException
    • getXAResource

      public XAResource getXAResource()
      定義:
      getXAResource インタフェース内 XAConnection
    • start

      public void start(Xid xid, int flags) throws XAException

      Preconditions:

      1. Flags must be one of TMNOFLAGS, TMRESUME or TMJOIN
      2. xid != null
      3. Connection must not be associated with a transaction
      4. The TM hasn't seen the xid before

      Implementation deficiency preconditions:

      1. TMRESUME not supported.
      2. If flags is TMJOIN, we must be in ended state, and xid must be the current transaction
      3. Unless flags is TMJOIN, previous transaction using the connection must be committed or prepared or rolled back

      Postconditions:

      1. Connection is associated with the transaction
      定義:
      start インタフェース内 XAResource
      例外:
      XAException
    • end

      public void end(Xid xid, int flags) throws XAException

      Preconditions:

      1. Flags is one of TMSUCCESS, TMFAIL, TMSUSPEND
      2. xid != null
      3. Connection is associated with transaction xid

      Implementation deficiency preconditions:

      1. Flags is not TMSUSPEND

      Postconditions:

      1. Connection is disassociated from the transaction.
      定義:
      end インタフェース内 XAResource
      例外:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException

      Prepares transaction. Preconditions:

      1. xid != null
      2. xid is in ended state

      Implementation deficiency preconditions:

      1. xid was associated with this connection

      Postconditions:

      1. Transaction is prepared
      定義:
      prepare インタフェース内 XAResource
      例外:
      XAException
    • recover

      public Xid[] recover(int flag) throws XAException

      Recovers transaction. 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
      定義:
      recover インタフェース内 XAResource
      例外:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException

      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.

      Postconditions:

      1. Transaction is rolled back and disassociated from connection
      定義:
      rollback インタフェース内 XAResource
      例外:
      XAException
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      定義:
      commit インタフェース内 XAResource
      例外:
      XAException
    • isSameRM

      public boolean isSameRM(XAResource xares) throws XAException
      定義:
      isSameRM インタフェース内 XAResource
      例外:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Does nothing, since we don't do heuristics.
      定義:
      forget インタフェース内 XAResource
      例外:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout()
      We don't do transaction timeouts. Just returns 0.
      定義:
      getTransactionTimeout インタフェース内 XAResource
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds)
      We don't do transaction timeouts. Returns false.
      定義:
      setTransactionTimeout インタフェース内 XAResource