Try OpenEdge Now
skip to main content
Database Administration
Protecting Your Data : Distributed Transaction Processing : Two-phase commit with ABL clients : Enabling two-phase commit
 
Enabling two-phase commit
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.
Note: You must create and maintain a transaction log (TL) area for your database in order to use two-phase commit. For more information, see Transactionlog area.
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:
proutil db-name -C 2phase begin [ -crd | -tp nickname ]
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.
Note: Be sure to specify a unique nickname. If you must resolve limbo transactions with two databases that have the same path name but are on different machines, PROUTIL does not distinguish between the two databases.