BeginTransaction (obsolete)

Description

Creates an EAServer transaction and associates it with the calling thread.

Obsolete function

BeginTransaction is obsolete, because EAServer is no longer supported since PowerBuilder 2017. An obsolete feature is no longer eligible for technical support and will no longer be enhanced, although it is still available.

Applies to

CORBACurrent objects

Syntax

CORBACurrent.BeginTransaction (  )

Argument

Description

CORBACurrent

Reference to the CORBACurrent service instance


Return value

Boolean.

Returns true if it succeeds and false if the transaction could not be created.

Usage

The BeginTransaction function creates a transaction and modifies the transaction context of the calling thread so that it is associated with the transaction. This enables the calling thread to obtain information about the transaction and control commits and rollbacks. BeginTransaction can be called by a client or a component that is marked as OTS style. EAServer must be using the two-phase commit transaction coordinator (OTS/XA). If the calling thread is already associated with a transaction, BeginTransaction returns false. Nested transactions are not supported.

Examples

This example shows the use of BeginTransaction to create a transaction from a client:

// Instance variables:
// CORBACurrent corbcurr
// Connection myconnect
long ll_rc
integer li_rc1, li_rc2
boolean lb_success
ll_rc = myconnect.ConnectToServer()
// insert error handling ...
li_rc1 = this.GetContextService("CORBACurrent", &
    corbcurr)
// insert error handling ...
li_rc2 = corbcurr.Init( myconnect )
// insert error handling ...
lb_success = corbcurr.BeginTransaction()
IF NOT lb_success THEN
    MessageBox ("Create Transaction Failed", &
    "The client may already be in a transaction")
    RETURN
ELSE
    ll_rc = myconnect.CreateInstance(lcst_mybookstore)
    // begin processing
...

See also

CommitDocking

GetContextService

GetStatus (obsolete)

GetTransactionName (obsolete)

Init (obsolete)

ResumeTransaction (obsolete)

RollbackOnly (obsolete)

RollbackTransaction (obsolete)

SetTimeout (obsolete)

SuspendTransaction (obsolete)