public interface TConnection
useAutoCommitMode()
.useLocalTransactionMode()
.TIsolationDegree
TLockMode
TLockwaitMode
TIsolationLevel
null
value of such a
parameter indicates that the Tamino default value is being used. You can also use the null
value
in a setter method to indicate you want the default Tamino parameter setting.You may change the value of such a parameter at any time but when that value will become effective depends on the transaction mode and the type of command.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT
This value indicates to use Tamino default values for the timeout parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the TConnection instance.
|
TIsolationDegree |
getIsolationDegree()
Gets the isolation degree.
|
java.util.Locale |
getLocale()
Gets Locale
|
TLockMode |
getLockMode()
Gets the lock mode.
|
TLockwaitMode |
getLockwaitMode()
Gets the current lockwait mode.
|
long |
getMaximumTransactionDuration()
Gets the maximum transaction duration in seconds.
Note: This method retrieves the servers default value, when this duration has not been set to a specific value (unequal to TConnection.DEFAULT_TIMEOUT)! |
long |
getNonActivityTimeout()
Gets the nonActivity timeout in seconds.
Note: This method retrieves the servers default value, when this timeout has not been set to a specific value (unequal to TConnection.DEFAULT_TIMEOUT)! |
int |
getSocketTimeout() |
TTransaction |
getTransaction()
Gets the current active transaction instance.
|
boolean |
isActive()
Indicates whether the session associated with the TConnection instance is active
|
boolean |
isClosed()
Indicates whether the TConnection instance is closed or not.
|
TAdministrationAccessor |
newAdministrationAccessor()
Creates a TAdministrationAccessor instance that is bound to this connection.
|
TNonXMLObjectAccessor |
newNonXMLObjectAccessor(TAccessLocation accessLocation)
Creates a TNonXMLObjectAccessor instance that is bound to this connection.
|
TSchemaDefinition2Accessor |
newSchemaDefinition2Accessor(java.lang.Object xmlObjectModel)
Creates a TSchemaDefinition2Accessor instance that is bound to this connection.
|
TSchemaDefinition3Accessor |
newSchemaDefinition3Accessor(java.lang.Object xmlObjectModel)
Creates a TSchemaDefinition3Accessor instance that is bound to this connection.
|
TStreamAccessor |
newStreamAccessor(TAccessLocation accessLocation)
Creates a TStreamAccessor instance that is bound to this connection.
|
TSystemAccessor |
newSystemAccessor()
Creates a TSystemAccessor instance that is bound to this connection.
|
TXMLObjectAccessor |
newXMLObjectAccessor(TAccessLocation accessLocation,
java.lang.Object xmlObjectModel)
Creates a TXMLObjectAccessor instance that is bound to this connection.
|
TPreparedXQuery |
prepareQuery(java.lang.String expression)
Creates a TPreparedXQuery instance that is bound to this connection.
|
void |
reset()
Resets the TConnection instance to its initial state.
|
void |
setGroups(java.lang.String groups)
Sets the groups for the current user.
|
void |
setIsolationDegree(TIsolationDegree isolationDegree)
Sets the isolation degree.
|
void |
setLockMode(TLockMode lockMode)
Sets the lock mode.
|
void |
setLockwaitMode(TLockwaitMode lockwaitMode)
Sets the lockwait mode for a transaction.
|
void |
setMaximumTransactionDuration(long maximumTransactionDuration)
Sets the maximum transaction duration in seconds.
|
void |
setNonActivityTimeout(long nonActivityTimeout)
Sets the nonActivity timeout in seconds.
|
void |
setSocketTimeout(int timeout) |
void |
useAutoCommitMode()
Signals the TConnection connection to switch to autocommit mode.
|
TGlobalTransaction |
useGlobalTransactionMode(TGlobalTransactionSpecifier globalTransactionSpecifier)
Tells the connection to use and participate in a global transaction with the given isolation level and lockwait mode.
|
TLocalTransaction |
useLocalTransactionMode()
Signals the TConnection connection to switch to local transaction moode.
|
boolean |
usesAutoCommitMode()
Indicates whether the TConnection instance is in autocommit mode or not.
|
boolean |
usesGlobalTransactionMode()
Indicates whether the TConnection instance is in global transaction mode or not.
|
boolean |
usesLocalTransactionMode()
Indicates whether the TConnection instance is in local transaction mode or not.
|
static final long DEFAULT_TIMEOUT
TStreamAccessor newStreamAccessor(TAccessLocation accessLocation)
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.TNonXMLObjectAccessor newNonXMLObjectAccessor(TAccessLocation accessLocation)
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.TXMLObjectAccessor newXMLObjectAccessor(TAccessLocation accessLocation, java.lang.Object xmlObjectModel)
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.xmlObjectModel
- an instance of TXMLObjectModel indicating the object model to be used
for the accessor.TSchemaDefinition2Accessor newSchemaDefinition2Accessor(java.lang.Object xmlObjectModel)
xmlObjectModel
- an instance of TXMLObjectModel indicating the object model to be used
for the accessor.TSchemaDefinition3Accessor newSchemaDefinition3Accessor(java.lang.Object xmlObjectModel)
xmlObjectModel
- an instance of TXMLObjectModel indicating the object model to be used
for the accessor.TSystemAccessor newSystemAccessor()
TAdministrationAccessor newAdministrationAccessor()
void useAutoCommitMode() throws TTransactionModeChangeException
TTransactionModeChangeException
- signals an error while attempting to change the transaction
mode from local to autocommit.boolean usesAutoCommitMode()
TLocalTransaction useLocalTransactionMode() throws TTransactionModeChangeException
TTransactionModeChangeException
- signals an error while attempting to change the transaction
mode from autocommit to local.boolean usesLocalTransactionMode()
TGlobalTransaction useGlobalTransactionMode(TGlobalTransactionSpecifier globalTransactionSpecifier) throws TTransactionModeChangeException
globalTransactionSpecifier
- the global transaction identifier. Should be originated by transaction controller.TTransactionModeChangeException
boolean usesGlobalTransactionMode()
TTransaction getTransaction()
In a J2SE environment this method returns an instance of TLocalTransaction if the connection is in local transaction mode, otherwise null (i.e. if the connection is in auto commit mode.
In a J2EE environment is the TConnection instance was obtained through the Tamino Resource Adapter it will always return null.
void reset() throws TTransactionModeChangeException
In a J2SE environment, there is a distinction between non-pooled connections and pooled
connections.
If no connection pool is used and the TConnection instance is in autocommit mode
all session parameters like lockwait mode and isolation level are set to the Tamino defaults.
If no connection pool is used and the TConnection instance is in local transaction mode the connection is switched
to auto commit mode. This implies that the underlying Taino session is disconnected which in turn
implies that the current transaction is committed.
If a connection pool is used that has been configured to pool physical Tamino connections, none
of the session parameters are reset as they are properties of the pool and are immutable.
In a J2EE environment if the TConnection instance was obtained through the Tamino Resource Adapter, all session parameters are reset to their Tamino default settings.
TTransactionModeChangeException
- signals an error while attempting to change the transaction
mode from local to autocommit.void setLockwaitMode(TLockwaitMode lockwaitMode)
lockwaitMode
- the lockwait mode to be set, 'null' for Tamino default.TLockwaitMode getLockwaitMode()
void setIsolationDegree(TIsolationDegree isolationDegree)
isolationDegree
- the isolation degree to be set, 'null' for Tamino default.TIsolationDegree getIsolationDegree()
void setLockMode(TLockMode lockMode)
lockMode
- the lock mode to be set, 'null' for Tamino default.TLockMode getLockMode()
void setNonActivityTimeout(long nonActivityTimeout)
nonActivityTimeout
- the transaction nonActivity timeout in seconds be set,
TConnection.DEFAULT_TIMEOUT for Tamino default.long getNonActivityTimeout()
void setMaximumTransactionDuration(long maximumTransactionDuration)
maximumTransactionDuration
- the maximum transaction duration in seconds in seconds be set, TConnection.DEFAULT_TIMEOUT for Tamino default.long getMaximumTransactionDuration()
void setGroups(java.lang.String groups)
groups
- the groups for the current uservoid close() throws TConnectionCloseException
In a J2SE environment if no connection pool is used the underlying session with Tamino
is closed as well. Before closing the connection, the transaction mode is changed to autocommit.
This implies that if the TConnection instance was in local transaction mode, the local
transaction is committed.
If a connection pool is used which was configured to pool physical Tamino connections,
the underlying session with Tamino is NOT closed. However, if there is an open transaction,
a commit is issued against Tamino committed the current transaction.
In a J2EE environment if the TConnection instance was obtained through the Tamino Resource Adapter, the underlying session with Tamino is NOT closed. Instead the connection is returned to the connection pool managed by the J2EE application server and is ready for re-use.
TConnectionCloseException
- due to problems (such as database access) during the
the closure of the connection.boolean isClosed()
boolean isActive()
TPreparedXQuery prepareQuery(java.lang.String expression)
java.util.Locale getLocale()
void setSocketTimeout(int timeout)
int getSocketTimeout()
Copyright (c) 2017 Software AG. All Rights Reserved.