tppt.util
Class Transaction

java.lang.Object
  |
  +--tppt.util.Transaction

public class Transaction
extends java.lang.Object

Transaction class represents as a transaction method the user defined in the transaction prototype file.

Version:
1.1 04/25/00
Author:
Helen Yi Ren & Jie Su Last Modified: 10/29/2000 Jiang Yin

Field Summary
 double AccDeadLockTime
          Deprecated. This variable is not be used.
(package private)  java.util.Vector argumentValues
           
 int DEADLOCKED
           
 double DeadLockTime
          the accumulated response time when deadlock happends
 int EachDeadLock
           
 int EXCEPTION
           
(package private)  int isolationLevel
           
 int LOGICALLYFAILED
           
 double LogicFailTime
          The accumulated response time when login failure happends
 int NumOfDeadLock
          The accumulated number of deadlock happened in this transaction.
 int NumOfLogicFail
          the number of logic failures
 int NumOfSuccess
          Deprecated.  
(package private)  int paraCount
           
(package private)  java.util.Vector parameterNames
           
(package private)  java.util.Vector parameterTypes
           
 double responseTime
          Accumulated response time (The end time of procedure exection - the start time ) in milliseconds.
(package private)  java.lang.String returnType
           
 int SUCCEEDED
           
 double SuccessTime
          Deprecated. This variable is obsolete.
(package private)  java.lang.String transClassName
           
 int transCounter
          The accumulated number of the sucessful transactions.
 java.lang.String transName
           
 
Constructor Summary
Transaction(java.lang.String transClassName, java.lang.String transName, java.lang.String returnType)
          Constructs a Transaction that initialized with a transaction class name, transaction name and return type.
 
Method Summary
 Transaction copy()
          Return a Transaction instance that is the deep-copy of current Transaction object.
 int execTransaction()
          executes this transaction.
 int getIsoLevel()
           
 java.util.Vector getParaNames()
           
 java.lang.String getTransClassName()
          Returns the class name of this transaction.
 java.lang.String getTransName()
           
static void initDLcounter()
           
 void recordEndTime(long endTime)
          Set up the end time of this transaction.
 void recordStartTime(long startTime)
          Set up the start time of this transaction.
 void recordTransRT(double responseTime, int whichTime)
          Store the response time according to the return result by user-defined transaction procedure.
 void recordTransRT(double responseTime, java.lang.Integer result)
           
 void setArgumentValues(int parameterIndex, java.lang.Object argumentValue)
           
 void setIsolationLevel(int level)
           
 void setParameterNames(int parameterIndex, java.lang.String parameterName)
          Set the name for parameterIndex-th parameter.
 void setParameterTypes(int parameterIndex, java.lang.String parameterType)
          Set the type for parameterIndex-th parameter.
(package private)  void showError(java.lang.String errorMsg)
           
 java.lang.String toString()
          return a string representation of Transaction, for debugging purpose
static void updateDLcounter()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

transClassName

java.lang.String transClassName

transName

public java.lang.String transName

returnType

java.lang.String returnType

parameterTypes

java.util.Vector parameterTypes

parameterNames

java.util.Vector parameterNames

argumentValues

java.util.Vector argumentValues

paraCount

int paraCount

isolationLevel

int isolationLevel

responseTime

public double responseTime
Accumulated response time (The end time of procedure exection - the start time ) in milliseconds.

transCounter

public int transCounter
The accumulated number of the sucessful transactions.

NumOfDeadLock

public int NumOfDeadLock
The accumulated number of deadlock happened in this transaction.

DeadLockTime

public double DeadLockTime
the accumulated response time when deadlock happends

AccDeadLockTime

public double AccDeadLockTime
Deprecated. This variable is not be used.


NumOfSuccess

public int NumOfSuccess
Deprecated.  

This variable is obsolete.

SuccessTime

public double SuccessTime
Deprecated. This variable is obsolete.


NumOfLogicFail

public int NumOfLogicFail
the number of logic failures

LogicFailTime

public double LogicFailTime
The accumulated response time when login failure happends

DEADLOCKED

public final int DEADLOCKED

LOGICALLYFAILED

public final int LOGICALLYFAILED

SUCCEEDED

public final int SUCCEEDED

EXCEPTION

public final int EXCEPTION

EachDeadLock

public int EachDeadLock
Constructor Detail

Transaction

public Transaction(java.lang.String transClassName,
                   java.lang.String transName,
                   java.lang.String returnType)
Constructs a Transaction that initialized with a transaction class name, transaction name and return type.
Method Detail

setParameterTypes

public void setParameterTypes(int parameterIndex,
                              java.lang.String parameterType)
Set the type for parameterIndex-th parameter.
Parameters:
parameterIndex - index at which the specified element is to be inserted.
parameterType - the parameter type.

setParameterNames

public void setParameterNames(int parameterIndex,
                              java.lang.String parameterName)
Set the name for parameterIndex-th parameter.
Parameters:
parameterIndex - index at which the specified element is to be inserted.
parameterName - the parameter Name.

setArgumentValues

public void setArgumentValues(int parameterIndex,
                              java.lang.Object argumentValue)

setIsolationLevel

public void setIsolationLevel(int level)

getTransClassName

public java.lang.String getTransClassName()
Returns the class name of this transaction.

getTransName

public java.lang.String getTransName()

getParaNames

public java.util.Vector getParaNames()

getIsoLevel

public int getIsoLevel()

copy

public Transaction copy()
Return a Transaction instance that is the deep-copy of current Transaction object.
Returns:
the copy Transaction instance.

toString

public java.lang.String toString()
return a string representation of Transaction, for debugging purpose
Overrides:
toString in class java.lang.Object

showError

void showError(java.lang.String errorMsg)

execTransaction

public int execTransaction()
executes this transaction.
Returns:
returns the result of transaction procedure. The meaning of return value is listed below: >=0 -- suceeded -5 -- deadlock -1 -- errors in student's procedure -2 -- logic failure -201 -- ClassNotFoundException -202 -- SecurityException -203 -- NoSuchMethodException -204 -- InstantiationException -205 -- IllegalAccessException -206 -- IllegalArgumentException -207 -- InvocationTargetException -208 -- Failure in setting isolation level -209 -- ClassNotLoadedException

recordStartTime

public void recordStartTime(long startTime)
Set up the start time of this transaction.
Parameters:
the - start time in millisecond.

recordEndTime

public void recordEndTime(long endTime)
Set up the end time of this transaction.
Parameters:
the - end time in millisecond.
See Also:
GlobalData.transEndTime

recordTransRT

public void recordTransRT(double responseTime,
                          java.lang.Integer result)

recordTransRT

public void recordTransRT(double responseTime,
                          int whichTime)
Store the response time according to the return result by user-defined transaction procedure. Warning: DeadLockTime is stored by 2 different way. In transaction itself, it saved as non-accumulated, but in GlobalData.transactions array, it saved as accumulated. However, when generating the report, the value is read from the GlobalData.transactions.
Parameters:
responseTime - the response time calculated by program. (=endTime - startTime)
whichTime - which return type.

initDLcounter

public static void initDLcounter()

updateDLcounter

public static void updateDLcounter()