JoltTransactionNew Function

Action

Creates a new JoltTransaction object. A JoltTransaction object can be used to include several services into a single transaction. Calling this function implies the beginning of the transaction. When a transaction is timed out, the user must rollback the transaction immediately. Service calls become part of a transaction when the associated transaction object is passed to the service call (see JoltCall function).

Include file

Jolt.bdh

Syntax

JoltTransactionNew( in nTimeout : number,
                    in hSession : number ): number;

Return value

Handle to the new JoltTransaction object.

Parameter Description
nTimeout

Timeout for the transaction. If the transaction is not completed within this period of time, Jolt generates a transaction exception.

Specifying a timeout of 0 sets the timeout to the maximum value for the system

hSession Handle to a JoltSession object created with JoltSessionNew

Example

var
  hSession, hSessionAttr, hTransaction: number; 
dcltrans
  transaction TInit
  begin
    JavaSetOption(JAVA_VERSION, JAVA_V11);
    JavaSetOption(JAVA_HOME, "c:/jdk1.1.7");
    JavaSetOption(JAVA_CLASSPATH, "c:/jdk1.1.7");
    JoltInit();     hSessionAttr := JoltSessionAttributesNew();
    JoltSetString(hSessionAttr, APPADDRESS, "//lab:8000");
    hSession := JoltSessionNew(hSessionAttr, "", "ATM", "", "");
  end TInit; 

  transaction TMain
  begin
    hTransaction := JoltTransactionNew(0, hSession);
    ...
    JoltCommit(hTransaction);
  end TMain;
  transaction TShutdown
  begin
    JoltEndSession(hSession);
    JoltFreeObject(hTransaction);
    JoltFreeObject(hSession);
    JoltFreeObject(hSessionAttr);
  end TShutdown;

See also

Java: bea.jolt.JoltTransaction class