com.softwareag.tamino.db.api.connection
Class TAutoCommitTransactionMode

java.lang.Object
  extended by com.softwareag.tamino.db.api.connection.TTransactionMode
      extended by com.softwareag.tamino.db.api.connection.TAutoCommitTransactionMode
All Implemented Interfaces:
TTransaction

public class TAutoCommitTransactionMode
extends TTransactionMode

TAutoCommitTransactionMode is the implementation of TTransactionMode for auto commit transaction mode. It implements the update plug in method for the transaction mode. Also it implements the behaviour of writing the transaction mode to a TCommandStatement instance.

Version:
$Revision: 1.18 $
Author:
Marcus Schreyer

Constructor Summary
TAutoCommitTransactionMode(TTransactionModeCoordinator transactionModeCoordinator)
          Initializes with the given session state.
 
Method Summary
 void begin()
          Begin this transaction mode.
protected  void doUpdate(TStreamHeader header)
          Updates the transaction state according to the transaction specific content of the stream header.
 void end()
          End this transaction mode.
 boolean needsSessionState(TCommand command)
          Test whether the given command statement needs session state updating, i.e.
 boolean supports(TCommand command)
          Indicates if the given command is supported within the current transaction mode.
 java.lang.String toString()
          Writes the current transaction state into a String.
 void writeTo(TCommandStatement commandStatement)
          Writes the current transaction mode to the given commandStatement.
 
Methods inherited from class com.softwareag.tamino.db.api.connection.TTransactionMode
getGenericAccessor, getLocale, getSessionState, getTransactionModeCoordinator, getTransactionParameters, getTransactionTimeoutParameters, isReleased, release, setLocale, update, use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TAutoCommitTransactionMode

public TAutoCommitTransactionMode(TTransactionModeCoordinator transactionModeCoordinator)
Initializes with the given session state.

Method Detail

writeTo

public void writeTo(TCommandStatement commandStatement)
Writes the current transaction mode to the given commandStatement.

Specified by:
writeTo in class TTransactionMode
Parameters:
commandStatement - gets the current transaction state.

supports

public boolean supports(TCommand command)
Indicates if the given command is supported within the current transaction mode. This is needed because there might be commands (currently only cursor specific commands) that cannot be used in a specific transaction mode.

Specified by:
supports in class TTransactionMode
Parameters:
command - is checked wheter it can be use with the current transaction mode.
Returns:
true if the given commandStatement can be used, false otherwise.

needsSessionState

public boolean needsSessionState(TCommand command)
Test whether the given command statement needs session state updating, i.e. sending sessionId/Key and updating.

Specified by:
needsSessionState in class TTransactionMode
Parameters:
command - test for this command.
Returns:
true -> session state update is needed, otherwise false.

begin

public void begin()
           throws TAccessorException
Begin this transaction mode.

Specified by:
begin in class TTransactionMode
Throws:
TAccessorException

end

public void end()
         throws TAccessorException
End this transaction mode.

Specified by:
end in class TTransactionMode
Throws:
TAccessorException

doUpdate

protected void doUpdate(TStreamHeader header)
                 throws TSessionStateUpdateException
Updates the transaction state according to the transaction specific content of the stream header. Returns true of transaction state has been updated, false otherwise.

Specified by:
doUpdate in class TTransactionMode
Parameters:
header - is the TStreamHeader of a TInputStream instance.
Throws:
TSessionStateUpdateException - in case of a failure.

toString

public java.lang.String toString()
Writes the current transaction state into a String.

Overrides:
toString in class java.lang.Object
Returns:
the current transaction state as a String.


Copyright (c) 2013 Software AG. All Rights Reserved.