public class TConnectionImpl extends java.lang.Object implements TDarkConnection
DEFAULT_TIMEOUT
Modifier | Constructor and Description |
---|---|
protected |
TConnectionImpl(TInvocation invocation)
Protected Constructor.
|
protected |
TConnectionImpl(TInvocation invocation,
java.util.Locale locale) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection to Tamino.
|
java.lang.String |
getDatabaseURI()
Return the database URI as a string.
|
TInvocation |
getInvocation()
Return the invocation.
|
TIsolationDegree |
getIsolationDegree()
Gets the current isolation degree.
|
boolean |
getKeepAlive()
Get the keep alive property.
|
java.util.Locale |
getLocale()
Gets the locale.
|
TLockMode |
getLockMode()
Gets the current 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 if the connection is closed.
|
boolean |
isFirstCallPending()
Check whether th efirst call in a new transaction is pending.
|
boolean |
isHealthy()
Indicates whether the connection is still healthy.
|
boolean |
isInDangerToBeStale()
Indicates whether the undelyign physical Tamino connection might have been timed out
due to the nonActivityTimeout.
|
TAdministrationAccessor |
newAdministrationAccessor()
Creates a TAdministrationAccessor instance that is bound to this connection.
|
TNonXMLObjectAccessor |
newNonXMLObjectAccessor(TAccessLocation accessLocation)
Creates a new TNonXMLObjectAccessor object that is bound to this connection.
|
TSchemaDefinition2Accessor |
newSchemaDefinition2Accessor(java.lang.Object xmlObjectModel)
Creates a new TSchemaDefinition2Accessor object 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 TStreamAccessor 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 objects 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 |
resetTransactionParameters()
Resets the transactional parameters to represent the Tamino defaults.
|
void |
resetTransactionTimeoutParameters()
Resets the timeout parameters to represent the Tamino defaults.
|
void |
setFirstCallPending(boolean b)
Sets the indicator to indicate that the first call in a new transaction is pending.
|
void |
setGroups(java.lang.String groups)
Sets the groups for the current user.
|
void |
setIsolationDegree(TIsolationDegree isolationDegree)
Sets the isolation degree for a local or global transaction.
|
void |
setKeepAlive(boolean keepAlive)
Set the keep alive feature of the connection.
Setting keepAlive to true will cause this connection to schedule a task
that periodically will try to refresh the databases nonActivityTimeout.Otherwise it will stop the keep alive task. |
void |
setLockMode(TLockMode lockMode)
Sets the lock mode for a local or global transaction.
|
void |
setLockwaitMode(TLockwaitMode lockwaitMode)
Sets the lockwait mode for a local or global 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 globalTransactionSpecifier)
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 if currently a global transaction mode is used.
|
boolean |
usesLocalTransactionMode()
Indicates if currently a local transaction mode is used.
|
protected TConnectionImpl(TInvocation invocation) throws TCommunicationException
invocation
- TCommunicationException
protected TConnectionImpl(TInvocation invocation, java.util.Locale locale) throws TCommunicationException
TCommunicationException
public TStreamAccessor newStreamAccessor(TAccessLocation accessLocation)
newStreamAccessor
in interface TConnection
accessLocation
- the TAccessLocation instance specifying the location for
the accessor.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 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 setKeepAlive(boolean keepAlive)
keepAlive
to true
will cause this connection to schedule a task
that periodically will try to refresh the databases nonActivityTimeout.setKeepAlive
in interface TDarkConnection
keepAlive
- on true this connection tries to refresh the timeout; otherwise not.public boolean getKeepAlive()
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 globalTransactionSpecifier) throws TTransactionModeChangeException
useGlobalTransactionMode
in interface TConnection
globalTransactionSpecifier
- 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
- for a local or global transaction.public TLockwaitMode getLockwaitMode()
getLockwaitMode
in interface TConnection
public void setIsolationDegree(TIsolationDegree isolationDegree)
setIsolationDegree
in interface TConnection
isolationDegree
- for a local or global transaction.public TIsolationDegree getIsolationDegree()
getIsolationDegree
in interface TConnection
public void setLockMode(TLockMode lockMode)
setLockMode
in interface TConnection
lockwaitMode
- for a local or global transaction.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,
TConnection.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 java.util.Locale getLocale()
getLocale
in interface TConnection
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 the
the closure of the connection.public boolean isClosed()
isClosed
in interface TConnection
public boolean isHealthy()
isHealthy
in interface TDarkConnection
public void resetTransactionParameters()
resetTransactionParameters
in interface TDarkConnection
public void resetTransactionTimeoutParameters()
resetTransactionTimeoutParameters
in interface TDarkConnection
public TInvocation getInvocation()
getInvocation
in interface TDarkConnection
public java.lang.String getDatabaseURI()
public boolean isInDangerToBeStale()
TDarkConnection
isInDangerToBeStale
in interface TDarkConnection
public boolean isFirstCallPending()
isFirstCallPending
in interface TDarkConnection
public void setFirstCallPending(boolean b)
setFirstCallPending
in interface TDarkConnection
com.softwareag.tamino.db.api.connection.TDarkConnection.isFirstCallPending()
public TPreparedXQuery prepareQuery(java.lang.String expression)
prepareQuery
in interface TConnection
public boolean isActive()
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.