|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.softwareag.tamino.db.api.invocation.TPooledConnectionReconnectHandler
public class TPooledConnectionReconnectHandler
The TPooledConnectionReconnectHandler is only active for connections which are pooled, or to be more precise for TConnection objects which are in local transaction mode and wrpped by TPooledConnection objects. For the invocation object of these TConnection objects a handler is instantiated which checks every first time a pooled connection is about to be reused. In that situation it is checked whether in the meantime the Tamino session might be timed out by Tamino. If that is the case, a reconnect is made by simply issuing a new _connect and replacing the session state parameters. The old session is simply forgotten.
Constructor Summary | |
---|---|
TPooledConnectionReconnectHandler(TDarkConnection connection)
Construct a new TPooledConnectionReconnectHandler. |
Method Summary | |
---|---|
int |
getFailedReconnects()
Gets the number of failed reconnects |
int |
getReconnects()
Gets the number of reconnects |
void |
prepare(TRetryInvocation invocation,
TCommandStatement commandStatement,
java.lang.String collection,
java.lang.String doctype,
java.lang.String docname,
boolean useTransactionMode)
Prepare a potential reconnect. |
void |
reconnect(TRetryInvocation invocation)
Checks whether a reconnect is required and if so attempts to do so. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TPooledConnectionReconnectHandler(TDarkConnection connection)
TPooledConnectionReconnectHandler
- the T(Dark)Connection object for which this hanl�der is active.Method Detail |
---|
public void prepare(TRetryInvocation invocation, TCommandStatement commandStatement, java.lang.String collection, java.lang.String doctype, java.lang.String docname, boolean useTransactionMode)
invocation
- spcifies the invocation.commandStatement
- specifies the concrete Tamino specific action that should be fulfilled.
Session information is not yet set.collection
- is the collection of the Tamino DB associated to the command.doctype
- within a schema of the given collection associated to the command.docname
- is the name of the document associated to the command.useTransactionState
- specifies whether the transaction state shall be considered.
Note that this implementation is identical to the logic followed by the TInvocationRetryOnConnectionTimeoutHandler.
A different approach would also be possible: The _connect has to be parameterized exactly
as the pool to which it belongs was parameterized by a TConnectionPoolDescriptor. This information
could therefore alos be used to make the reconnect. This, however, requires that we have a
way to find the pool in question.public void reconnect(TRetryInvocation invocation)
invocation
- specifies the invocation.public int getReconnects()
public int getFailedReconnects()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |