Package org.postgresql.xa
Enum PGXAConnection.State
- java.lang.Object
-
- java.lang.Enum<PGXAConnection.State>
-
- org.postgresql.xa.PGXAConnection.State
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<PGXAConnection.State>
- Enclosing class:
- PGXAConnection
private static enum PGXAConnection.State extends java.lang.Enum<PGXAConnection.State>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACTIVEPGXAConnection.start(Xid, int)has been called, and we're associated with an XA transaction.ENDEDPGXAConnection.end(Xid, int)has been called, but the transaction has not yet been prepared.IDLEPGXAConnectionnot associated with a XA-transaction.
-
Constructor Summary
Constructors Modifier Constructor Description privateState()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PGXAConnection.StatevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static PGXAConnection.State[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IDLE
public static final PGXAConnection.State IDLE
PGXAConnectionnot associated with a XA-transaction. You can still callPGXAConnection.getConnection()and use the connection outside XA.currentXidisnull. autoCommit istrueon a connection by getConnection, per normal JDBC rules, though the caller can change it tofalseand manage transactions itself using Connection.commit and rollback.
-
ACTIVE
public static final PGXAConnection.State ACTIVE
PGXAConnection.start(Xid, int)has been called, and we're associated with an XA transaction.currentXidis valid. autoCommit is false on a connection returned by getConnection, and should not be messed with by the caller or the XA transaction will be broken.
-
ENDED
public static final PGXAConnection.State ENDED
PGXAConnection.end(Xid, int)has been called, but the transaction has not yet been prepared.currentXidis still valid. You shouldn't use the connection for anything else than issuing aXAResource.commit(Xid, boolean)or rollback.
-
-
Method Detail
-
values
public static PGXAConnection.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PGXAConnection.State c : PGXAConnection.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PGXAConnection.State valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-