|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttyrex.resource.jdbc.xa.TyrexConnection
tyrex.resource.jdbc.xa.ClientConnection
final class ClientConnection
Encapsulates an application's view of an XA/pooled connection.
The XA connection is managed by the application server through it's
XAConnection
interface. The underlying JDBC
connection is a standard JDBC connection. The application's
JDBC connection gives access to the underlying JDBC connection but
is managed by the application server. The application is given an
instance of this class and not the underlying connection directly.
XAConnectionImpl
,
XADataSourceImpl
,
Connection
Field Summary |
---|
Fields inherited from interface java.sql.Connection |
---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Constructor Summary | |
---|---|
ClientConnection(XAConnectionImpl xaConn,
XADataSourceImpl xaDataSource,
int clientId)
Construct a new client connection to provide access to the underlying JDBC connection (underlying) on behalf of an XA/pooled connection (xaConn). |
Method Summary | |
---|---|
void |
commit()
|
java.sql.Array |
createArrayOf(java.lang.String typeName,
java.lang.Object[] elements)
|
java.sql.Blob |
createBlob()
|
java.sql.Clob |
createClob()
|
java.sql.NClob |
createNClob()
|
java.sql.SQLXML |
createSQLXML()
|
java.sql.Struct |
createStruct(java.lang.String typeName,
java.lang.Object[] attributes)
|
boolean |
getAutoCommit()
|
java.util.Properties |
getClientInfo()
|
java.lang.String |
getClientInfo(java.lang.String name)
|
protected void |
internalClose()
Method that actually closes the connection. |
protected java.sql.Connection |
internalGetUnderlyingConnection()
Called to retrieve the underlying JDBC connection. |
boolean |
isClosed()
Return true if the connection is closed. |
boolean |
isValid(int timeout)
|
boolean |
isWrapperFor(java.lang.Class iface)
|
protected void |
notifyError(java.sql.SQLException except)
Called when an exception is thrown by the underlying connection to determine whether the exception is critical or not. |
void |
rollback()
|
void |
setAutoCommit(boolean autoCommit)
|
void |
setClientInfo(java.util.Properties properties)
|
void |
setClientInfo(java.lang.String name,
java.lang.String value)
|
java.lang.String |
toString()
Called by XAConnectionImpl to terminate this connection
by dissociating it from the underlying JDBC connection. |
java.lang.Object |
unwrap(java.lang.Class iface)
|
Methods inherited from class tyrex.resource.jdbc.xa.TyrexConnection |
---|
clearWarnings, close, createStatement, createStatement, createStatement, finalize, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.sql.Connection |
---|
clearWarnings, close, createStatement, createStatement, createStatement, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
Constructor Detail |
---|
ClientConnection(XAConnectionImpl xaConn, XADataSourceImpl xaDataSource, int clientId)
xaConn
- The XA/pooled connection that created this
client connectionxaDataSource
- the data source that created the xaConnclientId
- A unique identifier handed to us by
XAConnection
underlying
- The underlying JDBC connectionMethod Detail |
---|
public void setAutoCommit(boolean autoCommit) throws java.sql.SQLException
setAutoCommit
in interface java.sql.Connection
setAutoCommit
in class TyrexConnection
java.sql.SQLException
public boolean getAutoCommit() throws java.sql.SQLException
getAutoCommit
in interface java.sql.Connection
getAutoCommit
in class TyrexConnection
java.sql.SQLException
public void commit() throws java.sql.SQLException
commit
in interface java.sql.Connection
commit
in class TyrexConnection
java.sql.SQLException
public void rollback() throws java.sql.SQLException
rollback
in interface java.sql.Connection
rollback
in class TyrexConnection
java.sql.SQLException
protected void internalClose() throws java.sql.SQLException
TyrexConnection
internalClose
in class TyrexConnection
java.sql.SQLException
- if there is a problem closing the connectionTyrexConnection.close()
public boolean isClosed()
TyrexConnection
isClosed
in interface java.sql.Connection
isClosed
in class TyrexConnection
public java.lang.String toString()
XAConnectionImpl
to terminate this connection
by dissociating it from the underlying JDBC connection.
The application would call TyrexConnection.close()
but XAConnectionImpl
cannot, since pooled connection requirements
will cause an inifinite loop. This method should not attempt
to notify either a closure or fatal error, but rather throw an
exception if it fails.
toString
in class java.lang.Object
protected void notifyError(java.sql.SQLException except)
notifyError
in class TyrexConnection
except
- The exception thrown by the underlying
connectionprotected java.sql.Connection internalGetUnderlyingConnection() throws java.sql.SQLException
internalGetUnderlyingConnection
in class TyrexConnection
java.sql.SQLException
- if the connection cannot be retrieved.TyrexConnection.getUnderlyingConnection()
public java.sql.Struct createStruct(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
createStruct
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Array createArrayOf(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
createArrayOf
in interface java.sql.Connection
java.sql.SQLException
public java.util.Properties getClientInfo() throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
java.sql.SQLException
public java.lang.String getClientInfo(java.lang.String name) throws java.sql.SQLException
getClientInfo
in interface java.sql.Connection
java.sql.SQLException
public void setClientInfo(java.util.Properties properties) throws java.sql.SQLClientInfoException
setClientInfo
in interface java.sql.Connection
java.sql.SQLClientInfoException
public void setClientInfo(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
setClientInfo
in interface java.sql.Connection
java.sql.SQLClientInfoException
public boolean isValid(int timeout) throws java.sql.SQLException
isValid
in interface java.sql.Connection
java.sql.SQLException
public java.sql.SQLXML createSQLXML() throws java.sql.SQLException
createSQLXML
in interface java.sql.Connection
java.sql.SQLException
public java.sql.NClob createNClob() throws java.sql.SQLException
createNClob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Blob createBlob() throws java.sql.SQLException
createBlob
in interface java.sql.Connection
java.sql.SQLException
public java.sql.Clob createClob() throws java.sql.SQLException
createClob
in interface java.sql.Connection
java.sql.SQLException
public boolean isWrapperFor(java.lang.Class iface)
isWrapperFor
in interface java.sql.Wrapper
public java.lang.Object unwrap(java.lang.Class iface)
unwrap
in interface java.sql.Wrapper
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |