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 C Function Reference

tpgetctxt(3c)

Name

tpgetctxt() - retrieve a context identifier for the current application association

Synopsis

#include <atmi.h>
int tpgetctxt(TPCONTEXT_T *context, long flags)

Description

tpgetctxt() retrieves an identifier that represents the current application context and places that identifier in context. This function operates on a per-thread basis in a multithreaded environment, and on a per-process basis in a non-threaded environment.

Typically, a thread

  1. Calls tpinit()

  2. Calls tpgetctxt()

  3. Handles the value of context as follows:

The second argument, flags, is not currently used and must be set to 0.

tpgetctxt() may be called in single-context applications as well as in multicontext applications.

A thread in a multithreaded application may issue a call to tpgetctxt() while running in any context state, including TPINVALIDCONTEXT.

Return Values

Upon successful completion, tpgetctxt() returns a non-negative value. Context is set to the current context ID, which may be represented by any of the following:

Upon failure, tpgetctxt() returns a value of -1 and sets tperrno to indicate the error condition.

Errors

Upon failure, tpgetctxt() sets tperrno to one of the following values.

[TPEINVAL]

Invalid arguments have been given. For example, the value of context is NULL or the value of flags is not 0.

[TPESYSTEM]

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

[TPEOS]

An operating system error has occurred.

See Also

Introduction to the C Language Application-Transaction Monitor Interface, tpsetctxt(3c), tpterm(3c)