Enable two-phase commit
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
PROUTIL provides two-phase commit protection only if you enable two-phase commit on two or more of the databases involved in a distributed transaction. For example, if a transaction involves three databases and you enable two-phase commit for two of them, PROUTIL provides two-phase commit protection for the two databases. However, PROUTIL protects only the databases that you enable, so the transaction is not completely protected from failure. For true integrity, enable two-phase commit for all three databases.
You enable two-phase commit with the PROUTIL 2PHASE BEGIN qualifier. When you enable two-phase commit, you can specify the database that should serve as the coordinator database. You can also specify an alternate name (nickname) for the coordinator database.
The syntax for enabling two-phase commit is as follows:
|
The -crd parameter specifies that the database
can serve as a coordinator database. For example, if you enable
two-phase commit for three databases (db1, db2,
and db3) and you specify the -crd parameter
for db3, PROUTIL assigns db3 as the
coordinator database. However, if you specify the -crd parameter
for more than one database, PROUTIL arbitrarily assigns a coordinator
database from the databases that received the -crd parameter.
If you do not assign any database as a coordinator, all two-phase-commit-enabled
databases are potential coordinator databases. PROUTIL randomly
assigns a coordinator database from one of these databases.
Specify a unique nickname for the coordinator database with the -tp parameter.
If you do not specify a nickname, PROUTIL automatically chooses
the name of the database (without the .db extension)
as the nickname. For example, if you have a database named /usr/dbs/appl.db,
the nickname for the database is appl. If PROUTIL
assigns appl.db as the coordinator database,
it writes the nickname appl to the BI file
instead of the database's full path name. Specify nicknames of up
to eight characters. Specifying a shorter nickname decreases the
size of the notes that must be written.