com.informix.jdbcx

## Class IfxXAReusableConnection

- java.lang.Object
- - com.informix.jdbc.IfxSqliConnect
  - - com.informix.jdbcx.IfxXAReusableConnection

All Implemented Interfaces:
  IfmxConnection, IfxConnection, java.lang.AutoCloseable, java.sql.Connection, java.sql.Wrapper

    public class IfxXAReusableConnection
    extends IfxSqliConnect

### Field Summary

### Fields inherited from class com.informix.jdbc.IfxSqliConnect

`ANSIMODE, ANSIWARN, asfconn, cleaner, cleanerMaximumDelay, cleanerMinimumDelay, cleanerZeroPointPercentage, ConnEst, connInfo, dbName, delimIdent, encoption, externalVersion, fileList, freeclobwithrs, GclEnv, HASLOG, ifxAllowOut, ifxtojava, implicitCache, isOpen, javatoifx, jdbcGeneratedSavepointId_, jdbcGeneratedSavepointNamePrefix__, Noansiwarn, preparedStatementClosedCount, preparedStatementCount, preparedStatementReusedCount, productName, proto, protoClassName, queueOfConnections, replCheck, socketTimedOut, softCloseDone, stmtList, stmtReferenceQueue, stmtWeakReferenceCloseCount, svptList, useCaseCapName, usePut, userName`

### Fields inherited from interface com.informix.jdbc.IfxConnection

`LOGGING_MODE, MODE_ANSI, NO_DATABASE, NO_LOGGING_MODE, TRANSACTION_LAST_COMMITTED`

### Fields inherited from interface java.sql.Connection

`TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

### Constructor Summary

Constructors
Constructor and Description
`IfxXAReusableConnection(java.lang.String luser, java.lang.String lpasswd, IfxPooledConnection pooledConn, java.lang.String url, java.util.Properties props)` Constructor for the connection class:

### Method Summary

Methods
`protected void` `clearTransactions(boolean rollbackXids)`
`void` `close()` In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them to be automatically released; the close method provides this immediate release.
`void` `commit()` Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection.
`protected void` `finalize()`
`boolean` `getAutoCommit()` Get the current auto-commit state (overrides parent method) Auto-Commit mode for XA transaction is always false if in XA transaction return false else return super.getAutoCommit
`javax.transaction.xa.Xid` `getCurrentXid()`
`boolean` `inXATransaction()` Returns true if start has been called to begin (or resume) an XA transaction.
`protected boolean` `isCommitNeeded()`
`boolean` `isXAConnection()` Returns true if the connection is XA as opposed to plain.
`void` `rollback()` Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection.
`void` `setAutoCommit(boolean newAC)` Set the current auto-commit state (overrides parent method) Auto-Commit mode for XA transaction is always false if new mode != old mode and transaction started then throw exception if new mode == old mode and transaction started then ignore note: if in XA transaction then old mode == false

### Methods inherited from class com.informix.jdbc.IfxSqliConnect

`abort, addToBlobList, addToFileList, addUDTInfo, changeStmtId, clearWarnings, closeAllResultSets, closeAllStatements, createArrayOf, createBlob, createClob, createNClob, createProto, createSQLXML, createStatement, createStatement, createStatement, createStruct, deleteAllFiles, doesBlobNeedPurge, endMetaDataQuery, freeStatementWeakReferences, getAutoFree, getBlobCacheSize, getCachedPreparedStatement, getCatalog, getclEncoding, getClientInfo, getClientInfo, getclLocale, getclLocaleProp, getConnClassName, getConnectionDbName, getDatabaseProductVersion, getDatabaseType, getdbCentury, getdbDate, getdbEncoding, getdbLocale, getdbLocaleProp, getDbName, getDbProductName, getdbTime, getdbTodayDate, getdbTodayStart, getDbVersion, getFetchBufSize, getFPCacheFParam, getFPCacheRoutineId, getGeneratedCursor, getglDate, getglDateTime, getHDRType, getHoldability, getIFX_USEPUT, getIsBigInt, getIsBigSerial, getJDBCTempDir, getJDBCVersion, getMapFloat, getMapReal, getMaxLvarcharSize, getMetaData, getNetworkTimeout, getOPTOFC, getProto, getProtoClassName, getProtoTrace, getSchema, getSQLStatementOffset, getTrace, getTransactionIsolation, getTrimTrailingSpaces, getTypeMap, getUDTInfo, getUDTInfo, getUDTInfo, getUDTInfo, getURL, getuseDtenv, getUsePut, getUserName, getWarnings, getXnameByXid, is2GBFetchBufferSupported, is4ByteOffsetSupported, is90303, is9301, isANSI, isANSIJoin, isAutoFree, isAutoGeneratedKeysSupported, isBigintSupported, isClosed, isCommitEnabled, isDbOpen, isDelimIdentSet, isDescribeInputSupported, isDirect, isFPDescribeSupported, isGLS, isHDREnabled, isIEEEM, isInUserTransaction, IsLastCommittedSupported, isLongID, isLvcGtThan2kSupported, isMultipleUdrInOutSupported, isMultipleUdrOutSupported, isNamedParametersSupported, isOnLine, isOnLine5SER, isPAMAuthentication, isPrivateServerEnabled, isReadOnly, isRemove64KLimitSupported, isReplCheckColumnEnabled, isSavepointSupported, isSQBatchSupported, isSysmaster, isUSVER, isValid, isWrapperFor, isXPS, isXPSVER8_40, isXPSVER8_50, loadUDTba, lockSession, lockSession, markCursorsToClosed, markStatementAsReleased, nativeSQL, parseIfxLocale, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseBlob, releaseSavepoint, removeFromBlobTable, removeFromStmtList, removeSavepointFromList, resetDatabaseProperties, retCapName, returnEnc, rollback, scrubConnection, scrubConnectionReleasesAllStatements, setCatalog, setClientInfo, setClientInfo, setCommitEnabled, setDatabaseProductVersion, setFPCacheInfo, setHoldability, setIFX_USEPUT, setIsBigInt, setIsBigSerial, setLocale, setNetworkTimeout, SetPrimEVars, setReadOnly, setReplCheckColumnEnabled, setSavepoint, setSavepoint, setSavepointUnique, setSchema, setServerIsolationLevel, setStructInfo, setTransactionIsolation, setTxnIsolationLvl, setTypeMap, startMetaDataQuery, unlockSession, unwrap, xaSetSerWarnFlags`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IfxXAReusableConnection

    public IfxXAReusableConnection(java.lang.String luser,
                           java.lang.String lpasswd,
                           IfxPooledConnection pooledConn,
                           java.lang.String url,
                           java.util.Properties props)
                            throws java.sql.SQLException

Constructor for the connection class:

Throws:
  `java.sql.SQLException`

### Method Detail

#### finalize

    protected void finalize()

Overrides:
  `finalize` in class `IfxSqliConnect`

#### close

    public void close()
               throws java.sql.SQLException

Description copied from class: `IfxSqliConnect`
In some cases, it is desirable to immediately release a Connection's database and JDBC resources instead of waiting for them to be automatically released; the close method provides this immediate release.

Note: A Connection is automatically closed when it is garbage collected. Certain fatal errors also result in a closed Connection.

Specified by:
  `close` in interface `java.lang.AutoCloseable`
Specified by:
  `close` in interface `java.sql.Connection`
Overrides:
  `close` in class `IfxSqliConnect`
Throws:
  `java.sql.SQLException`

#### commit

    public void commit()
                throws java.sql.SQLException

Commit makes all changes made since the previous commit/rollback permanent and releases any database locks currently held by the Connection. This method should only be used when auto commit has been disabled and when not in an XA transaction (before/after/suspended)

If the current database does not support transactions, an SQLException is thrown.

Uses the IfxProtocol class's executeCommit() method to do the actual committing.

Specified by:
  `commit` in interface `java.sql.Connection`
Overrides:
  `commit` in class `IfxSqliConnect`
Throws:
  `java.sql.SQLException`

#### rollback

    public void rollback()
                  throws java.sql.SQLException

Rollback drops all changes made since the previous commit/rollback and releases any database locks currently held by the Connection. This method should only be used when auto commit has been disabled and when not in an XA transaction (before/after/suspended)

If the current database does not support transactions, an SQLException is thrown.

Uses the IfxProtocol class's executeCommit() method to do the actual rollback.

Specified by:
  `rollback` in interface `java.sql.Connection`
Overrides:
  `rollback` in class `IfxSqliConnect`
Throws:
  `java.sql.SQLException`

#### getAutoCommit

    public boolean getAutoCommit()
                          throws java.sql.SQLException

Get the current auto-commit state (overrides parent method) Auto-Commit mode for XA transaction is always false if in XA transaction return false else return super.getAutoCommit

Specified by:
  `getAutoCommit` in interface `java.sql.Connection`
Overrides:
  `getAutoCommit` in class `IfxSqliConnect`
Returns:
  Current state of auto-commit mode.
Throws:
  `java.sql.SQLException`
See Also:
  `IfxSqliConnect.setAutoCommit(boolean)`

#### setAutoCommit

    public void setAutoCommit(boolean newAC)
                       throws java.sql.SQLException

Set the current auto-commit state (overrides parent method) Auto-Commit mode for XA transaction is always false if new mode != old mode and transaction started then throw exception if new mode == old mode and transaction started then ignore note: if in XA transaction then old mode == false

Specified by:
  `setAutoCommit` in interface `java.sql.Connection`
Overrides:
  `setAutoCommit` in class `IfxSqliConnect`
Parameters:
  `autoCommit` - true enables auto-commit; false disables auto-commit.
Throws:
  `java.sql.SQLException`

#### isXAConnection

    public boolean isXAConnection()

Description copied from interface: `IfxConnection`
Returns true if the connection is XA as opposed to plain.

Specified by:
  `isXAConnection` in interface `IfxConnection`
Overrides:
  `isXAConnection` in class `IfxSqliConnect`

#### inXATransaction

    public boolean inXATransaction()

Description copied from interface: `IfxConnection`
Returns true if start has been called to begin (or resume) an XA transaction.

Specified by:
  `inXATransaction` in interface `IfxConnection`
Overrides:
  `inXATransaction` in class `IfxSqliConnect`

#### clearTransactions

    protected void clearTransactions(boolean rollbackXids)
                              throws java.sql.SQLException

Overrides:
  `clearTransactions` in class `IfxSqliConnect`
Throws:
  `java.sql.SQLException`

#### isCommitNeeded

    protected boolean isCommitNeeded()

Overrides:
  `isCommitNeeded` in class `IfxSqliConnect`

#### getCurrentXid

    public javax.transaction.xa.Xid getCurrentXid()