Moving From SSTs to MSTs
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Transactions, Locking & Isolation, Platform-Specific Issues
Version: 7.31 OS: AIX 4.3.3 I am new to Informix as well as this (4GL) shop. I am used to using MSTs (multi statement transaction) vs SSTs (single statement transactions) but, alas, here the isn't a COMMIT WORK in sight nor a transaction log. What would it require (besides the transaction log) to begin to use MSTs without breaking existing code? (I.e., if the system interpreted uncommitted statements as a giant transaction ... not good). Thank you, Lucky Lucky Leavell Phone: (800) 481-2393 or (812) 366-4066 UniXpress - Your Source for SCO FAX: (888) 231-9640 or (812) 366-3618 1560 Zoar Church Road NE Email: lucky@UniXpress.com Corydon, IN 47112-7374 WWW Home Page: http://www.UniXpress.com
"Lucky Leavell [RIS]" wrote:
>
> Version: 7.31
> OS: AIX 4.3.3
>
> I am new to Informix as well as this (4GL) shop. I am used to using MSTs
> (multi statement transaction) vs SSTs (single statement transactions)
> but, alas, here the isn't a COMMIT WORK in sight nor a transaction log.
> What would it require (besides the transaction log) to begin to use MSTs
> without breaking existing code? (I.e., if the system interpreted
> uncommitted statements as a giant transaction ... not good).
Informix supports databases created in (or modified to) one of four
transaction modes:
1) Non-Logged
Each statement is a singleton transaction and no multi-statement
transactions or ROLLBACKs are possible since there is not
transaction logging. BEGIN WORK, COMMIT WORK, and ROLLBACK WORK are
illegal statements in this mode.
2) Informix mode Unbuffered Logging
3) Informix mode Buffered Logging
In either of these modes transactions are possible but not required.
A single SQL statement executed outside of a BEGIN WORK, COMMIT or
ROLLBACK WORK statement pair is treated as a singleton transaction
which will automatically commit if successful and rollback if it
encounters any error. However, you can start a multi-statement
transaction with the BEGIN WORK statement and commit it with COMMIT
WORK or roll it back with ROLLBACK WORK.
4) ANSI mode Logging
This unbuffered logging mode implicitely begins a multi-statement
transaction when ANY SQL statement is executed outside of a
transaction (ie immediately after connecting or after a COMMIT or
ROLLBACK WORK statement). BEGIN WORK statements are illegal and
COMMIT WORK or ROLLBACK WORK is required in this mode. There are
no singleton transaction (SSTs).
So if you want MSTs you must have a database created in one of the logged
modes (ie not the first). You can alter the mode using ondblog then making
a level 0 archive of the engine using ontape or onbar or by adding the -A
<dblist>, -B <dblist> or -U >dblist> options to ontape directly.
To view the logging mode of your database see onmonitor and select
>status>database if you are logged in as Informix or just select >database
if another user. Or get my listdb utility which lists such information and
optionally much more. Listdb is part of the utils2_ak package in the IIUG
Software Repository.
Art S. Kagel