BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Reference   |   Topic List   |   Previous   |   Next   |   Contents

   BEA Tuxedo COBOL Function Reference

TPBEGIN(3cbl)

Name

TPBEGIN() - routine to begin a BEA Tuxedo system transaction

Synopsis

01 TPTRXDEF-REC.
COPY TPTRXDEF.

01
TPSTATUS-REC.
COPY TPSTATUS.

CALL "TPBEGIN" USING
TPTRXDEF-REC TPSTATUS-REC.

Description

A transaction in the BEA Tuxedo system is used to define a single logical unit of work that either wholly succeeds or has no effect whatsoever. A transaction allows work being performed in many processes, at possibly different sites, to be treated as an atomic unit of work. The initiator of a transaction uses TPBEGIN() and either TPCOMMIT() or TPABORT() to delineate the operations within a transaction. Once TPBEGIN() is called, communication with any other program can place the latter (of necessity, a server) in "transaction mode" (that is, the server's work becomes part of the transaction). Threads of control that join a transaction are called participants. A transaction always has one initiator and can have several participants. Only the initiator of a transaction can call TPCOMMIT() or TPABORT(). Participants can influence the outcome of a transaction by the settings in TPSVCDEF-REC they use when they call TPRETURN(). Once in transaction mode, any service requests made to servers are processed on behalf of the transaction (unless the requester explicitly specifies otherwise).

Note that if a program starts a transaction while it has any open connections that it initiated to conversational servers, these connections will not be upgraded to transaction mode. It is as if the TPNOTRAN setting had been specified on the TPCONNECT() call.

T-OUT specifies that the transaction should be allowed at least T-OUT seconds before timing out. Once a transaction times out it must be aborted. If T-OUT is 0, then the transaction is given the maximum number of seconds allowed by the system before timing out (that is, the timeout value equals the maximum value for an unsigned long as defined by the system).

Return Values

Upon successful completion, TPBEGIN() sets TP-STATUS to [TPOK].

Errors

Under the following conditions, TPBEGIN() fails and sets TP-STATUS to:

[TPEINVAL]

Invalid arguments were given.

[TPETRAN]

The caller cannot be placed in transaction mode because an error occurred starting the transaction.

[TPEPROTO]

TPBEGIN() was called in an improper context (for example, the caller is already in transaction mode).

[TPESYSTEM]

A BEA Tuxedo system error has occurred. The exact nature of the error is written to a log file.

[TPEOS]

An operating system error has occurred.

Notices

When using TPBEGIN(), TPCOMMIT() and TPABORT() to delineate a BEA Tuxedo system transaction, it is important to remember that only the work done by a resource manager that meets the XA0 interface (and is linked to the caller appropriately) has transactional properties. All other operations performed in a transaction are not affected by either TPCOMMIT() or TPABORT(). See buildserver(1) for details on linking resource managers that meet the XA interface into a server such that operations performed by that resource manager are part of a BEA Tuxedo system transaction.

See Also

TPABORT(3cbl), TPCOMMIT(3cbl), TPGETLEV(3cbl), TPSCMT(3cbl)