Named Transactions and Transaction Workspaces
The construct DECLARE TRANSACTION … NAME transaction-name [USING namedUniqueWorkspace]
allows explicit transactions to be configured and saved into the global environment in preparation for repeated use for any connection request or by any active connection.An instance of the saved transaction can be called into action by a specific form of the SET TRANSACTION
command:
For a connection request:
SET TRANSACTION NAME MyReadTransaction
or
SET TRANSACTION NAME MyReadTransaction USING MyDsnDb1
for separate requests within a single active connection:
SET TRANSACTION LOCAL NAME MyReadTransaction
or
SET TRANSACTION LOCAL NAME MyReadTransaction USING MyDsnDb1
and, in this connection, for another request:
SET TRANSACTION LOCAL NAME MyWriteTransaction
or
SET TRANSACTION LOCAL NAME MyWriteTransaction USING MyDsnDb1
The form SET TRANSACTION … NAME transaction-name [USING namedUniqueWorkspace]
differs from earlier implementations whereby the configuration set by the SET
command would be repeated for the next transaction.The inclusion of the NAME
and/or USING
clauses makes the configuration repeatable on demand by use of the name.
Important
|
A return to the usual mode of operation requires a detach/connect cycle. |