Global variables and XA transactions
In an XA environment, session global variable objects will not change. Session global variables, within an XA transaction, are not available to other sessions joining the transaction.
Introduction
If a global variable is created within a session, then it cannot be used by other sessions until the unit of work has committed. However, the newly created variable can be used within the session that created it before the unit of work is committed. This behavior is consistent with other created objects such as tables.
The length attribute and data type of a global variable does not vary once it is created. Furthermore, the global variable cannot be altered at all (for example, its default value).
- If the creation of a global variable is rolled back then the variable no longer exists.
- If the drop of a global variable is rolled back, the value of the global variable will be what it was before the drop.
XA interaction
Session global variables are scoped to a per session level within an XA transaction and are not available to other sessions that join the transaction.
Global variables are non-transactional state objects. Hence, in an XA environment (for both tightly coupled transactions and loosely coupled transactions), global variable objects (both existence and value) will not change at XA_end (nor for other XA APIs, like XA_start, XA_rollback).
- XA_rollback
- XA_end(SUCCESS)
- XA_start(NOFLAGS)
- XA_start(JOIN)