public class TPooledConnection extends java.lang.Object implements TConnection
DEFAULT_TIMEOUT
Constructor and Description |
---|
TPooledConnection(TDarkConnection genericConnection,
TConnectionPool pool)
Create a TPooledConnection instance with a single wrapped connection
which will be used for both auto commit and local transaction mode.
|
TPooledConnection(TDarkConnection autoCommitConnection,
TDarkConnection localTransactionConnection,
TConnectionPool pool)
Create a TPooledConnection instance with two wrapped connections each
used for different transaction modes.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection to Tamino.
|
java.lang.String |
getDatabaseURI()
Return the database URI as a string.
|
int |
getFailedReconnects()
Method getFailedReconnects
|
TIsolationDegree |
getIsolationDegree()
Gets the isolation degree.
|
java.util.Locale |
getLocale()
Gets the locale.
|
TLockMode |
getLockMode()
Gets the lock mode.
|
TLockwaitMode |
getLockwaitMode()
Gets the current lockwait mode
A 'null' value represents the Tamino default.
|
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 |
getReconnects()
Method getReconnects
|
int |
getSocketTimeout() |
TTransaction |
getTransaction()
Gets the current active transaction instance.
|
void |
invalidate(TAccessor accessor)
Removes the given accessor from the TPooledConnection
|
boolean |
isActive()
Indicates whether the session associated with the TConnection instance is active
|
boolean |
isClosed()
Indicates if the connection is closed.
|
TAdministrationAccessor |
newAdministrationAccessor()
Creates a new TAdministrationAccessor object that is bound to this connection.
|
TNonXMLObjectAccessor |
newNonXMLObjectAccessor(TAccessLocation accessLocation)
Creates a new TNonXMLObjectAccessor instance that is bound to this connection.
|
TSchemaDefinition2Accessor |
newSchemaDefinition2Accessor(java.lang.Object xmlObjectModel)
Creates a new TSchemaDefinition2Accessor instance that is bound to this connection.
|
TSchemaDefinition3Accessor |
newSchemaDefinition3Accessor(java.lang.Object xmlObjectModel)
Creates a new TSchemaDefinition3Accessor object that is bound to this connection.
|
TStreamAccessor |
newStreamAccessor(TAccessLocation accessLocation)
Creates a new TXMLStreamAccessor instance that is bound to this connection.
|
TSystemAccessor |
newSystemAccessor()
Creates a new TSystemAccessor object that is bound to this connection.
|
TXMLObjectAccessor |
newXMLObjectAccessor(TAccessLocation accessLocation,
java.lang.Object xmlObjectModel)
Creates a new 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 connection to its initial state.
|
void |
setFirstCallPending(boolean flag)
Indicates whether the pooled connection is already in use or not.
|
void |
setGroups(java.lang.String groups)
Sets the groups for the current user.
|
void |
setIsolationDegree(TIsolationDegree isolationDegree)
Sets the isolation degree.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
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()
Tells the connection to use autocommit mode.
|
TGlobalTransaction |
useGlobalTransactionMode(TGlobalTransactionSpecifier globalTransactionId)
Tells the connection to use and participate in a global transaction with the given isolation level and lockwait mode.
|
TLocalTransaction |
useLocalTransactionMode()
Tells the connection to use a local transaction with the given isolation level and lockwait mode.
|
boolean |
usesAutoCommitMode()
Indicates if currently an autocommit transaction mode is used.
|
boolean |
usesGlobalTransactionMode()
Indicates whether the TConnection instance is in global transaction mode or not.
|
boolean |
usesLocalTransactionMode()
Indicates if currently a local transaction mode is used.
|
public TPooledConnection(TDarkConnection genericConnection, TConnectionPool pool)
genericConnection
- the wrapped connection instancepool
- the connection pool this wrapper belongs topublic TPooledConnection(TDarkConnection autoCommitConnection, TDarkConnection localTransactionConnection, TConnectionPool pool)
autoCommitConnection
- the wrapped auto commit connection instancelocalTransactionConnection
- the wrapped local transaction mode instancepool
- the connection pool this wrapper belongs topublic int getFailedReconnects()
public int getReconnects()
public void setFirstCallPending(boolean flag)
flag
- a boolean indicating whether the first call is pending
or not.public void setLocale(java.util.Locale locale)
public java.util.Locale getLocale()
getLocale
in interface TConnection
public TNonXMLObjectAccessor newNonXMLObjectAccessor(TAccessLocation accessLocation)
newNonXMLObjectAccessor
in interface TConnection
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.public TXMLObjectAccessor newXMLObjectAccessor(TAccessLocation accessLocation, java.lang.Object xmlObjectModel)
newXMLObjectAccessor
in interface TConnection
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.public TStreamAccessor newStreamAccessor(TAccessLocation accessLocation)
newStreamAccessor
in interface TConnection
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.public TSchemaDefinition2Accessor newSchemaDefinition2Accessor(java.lang.Object xmlObjectModel)
newSchemaDefinition2Accessor
in interface TConnection
xmlObjectModel
- an instance of TXMLObjectModel indicating the object model to be used
for the accessor.public TSchemaDefinition3Accessor newSchemaDefinition3Accessor(java.lang.Object xmlObjectModel)
newSchemaDefinition3Accessor
in interface TConnection
xmlObjectModel
- an instance of TXMLObjectModel indicating the object model to be used
for the accessor.public TSystemAccessor newSystemAccessor()
newSystemAccessor
in interface TConnection
public TAdministrationAccessor newAdministrationAccessor()
newAdministrationAccessor
in interface TConnection
public void useAutoCommitMode() throws TTransactionModeChangeException
useAutoCommitMode
in interface TConnection
TTransactionModeChangeException
- due to a problem during changing the transaction
mode (e.g. from local to autocommit).public boolean usesAutoCommitMode()
usesAutoCommitMode
in interface TConnection
public TLocalTransaction useLocalTransactionMode() throws TTransactionModeChangeException
useLocalTransactionMode
in interface TConnection
TTransactionModeChangeException
- due to a problem during changing the transaction
mode (e.g. from autocommit to local).public boolean usesLocalTransactionMode()
usesLocalTransactionMode
in interface TConnection
public TGlobalTransaction useGlobalTransactionMode(TGlobalTransactionSpecifier globalTransactionId) throws TTransactionModeChangeException
useGlobalTransactionMode
in interface TConnection
globalTransactionId
- the global transaction identifier. Should be originated by transaction controller.TTransactionModeChangeException
public boolean usesGlobalTransactionMode()
usesGlobalTransactionMode
in interface TConnection
public TTransaction getTransaction()
getTransaction
in interface TConnection
public void reset() throws TTransactionModeChangeException
reset
in interface TConnection
TTransactionModeChangeException
- due to a problem during reseting the transaction mode to auto commit.public void setLockwaitMode(TLockwaitMode lockwaitMode)
setLockwaitMode
in interface TConnection
lockwaitMode
- the lockwait mode to be set, 'null' for Tamino default.public TLockwaitMode getLockwaitMode()
getLockwaitMode
in interface TConnection
public void setIsolationDegree(TIsolationDegree isolationDegree)
setIsolationDegree
in interface TConnection
isolationDegree
- the isolation degree to be set, 'null' for Tamino default.public TIsolationDegree getIsolationDegree()
getIsolationDegree
in interface TConnection
public void setLockMode(TLockMode lockMode)
setLockMode
in interface TConnection
lockMode
- the lock mode to be set, 'null' for Tamino default.public TLockMode getLockMode()
getLockMode
in interface TConnection
public void setNonActivityTimeout(long nonActivityTimeout)
setNonActivityTimeout
in interface TConnection
nonActivityTimeout
- the transaction nonActivity timeout in seconds be set,
DEFAULT_TIMEOUT for Tamino default.public long getNonActivityTimeout()
getNonActivityTimeout
in interface TConnection
public void setMaximumTransactionDuration(long maximumTransactionDuration)
setMaximumTransactionDuration
in interface TConnection
maximumTransactionDuration
- the maximum transaction duration in seconds in seconds be set, TConnection.DEFAULT_TIMEOUT for Tamino default.public long getMaximumTransactionDuration()
getMaximumTransactionDuration
in interface TConnection
public void setGroups(java.lang.String groups)
setGroups
in interface TConnection
groups
- the groups for the current userpublic void close() throws TConnectionCloseException
close
in interface TConnection
TConnectionCloseException
- due to problems (such as database access) during
closing the connection.public void invalidate(TAccessor accessor)
accessor
- public boolean isClosed()
isClosed
in interface TConnection
public java.lang.String getDatabaseURI()
public TPreparedXQuery prepareQuery(java.lang.String expression)
prepareQuery
in interface TConnection
public boolean isActive()
TConnection
isActive
in interface TConnection
public int getSocketTimeout()
getSocketTimeout
in interface TConnection
public void setSocketTimeout(int timeout)
setSocketTimeout
in interface TConnection
Copyright (c) 2017 Software AG. All Rights Reserved.