AIX | HP-UX | Linux | OS/2 | OS/390 | OS/400 | PTX | SUN | Win NT |
X | X | X | X | X | X | X | X | X |
Purpose
Specifies the transaction scope for SQL commands, determining whether Net.Data issues a COMMIT after each SQL command or after all SQL commands in an HTML block complete successfully. When you specify that all SQL commands must complete successfully before a commit, an unsuccessful SQL command causes all previously executed SQL to the same database in that block to be rolled back.
For the TRANSACTION_SCOPE variable to take effect, include it in the ENVIRONMENT statement in the Net.Data configuration file. You can then specify the value of this variable using a DEFINE statement or with the @DTW_ASSIGN() function.
Consistency considerations: On operating systems other than OS/400 and OS/390, updates to the database receiving unsuccessful responses might be rolled back while the updates to the other databases accessed in the same HTML block might be committed when all of the following conditions are true:
If you access multiple databases from Net.Data on OS/400 or using IBM's DataJoiner, you can achieve multiple database update coordination and consistency when updating from Net.Data.
On OS/400 and OS/390, TRANSACTION_SCOPE = "MULTIPLE" causes all IBM database updates issued from a single HTML block to be committed or rolled back together.
On operating systems other than OS/400, the REXX, Perl, and Java language environments run in their own separate operating system processes. Thus, any database updates you issue from these language environments are committed or rolled back separately from database updates issued from a Net.Data macro, regardless of the Net.Data TRANSACTION_SCOPE value.
Values
TRANSACTION_SCOPE="SINGLE"|"MULTIPLE"
Table 22. TRANSACTION_SCOPE Values
Values | Description |
---|---|
SINGLE | Net.Data issues a COMMIT after each SQL command in an HTML block successfully completes. |
MULTIPLE | Specifies the Net.Data issues a COMMIT only after all SQL commands in an HTML block complete successfully. MULTIPLE is the default. |
Examples
Example 1: Specifies to issue a COMMIT after each transaction
%DEFINE TRANSACTION_SCOPE="SINGLE"