nabarun
New User
Joined: 27 Apr 2005 Posts: 13 Location: india
|
|
|
|
Two-phase commit - DB2
PHASE I.
----------
STEP 1 :
When the database client requests that the unit of work be committed, a prepare message
is sent to all databases participating in the unit of work. Each database writes a "PREPARED"
record to its log files, and replies to the database client.
STEP 2 :
After the database client receives a positive response from all of the databases, it sends a
message to the transaction manager database, informing it that the unit of work is now ready
to be committed (PREPARED). The transaction manager database writes a "PREPARED" record to its
log file, and sends a reply to inform the client that the second phase of the commit process
can be started.
PHASE II
-----------
STEP 3 :
During the second phase of the commit process, the database client sends a message to all
participating databases to tell them to commit. Each database writes a "COMMITTED" record
to its log file, and releases the locks that were held for this unit of work. When the database
has completed committing the changes, it sends a reply to the client.
STEP 4 :
After the database client receives a positive response from all participating databases,
it sends a message to the transaction manager database, informing it that the unit of work
has been completed. The transaction manager database then writes a "COMMITTED" record to its
log file, indicating that the unit of work is complete, and replies to the client, indicating
that it has finished.
Regards,
Nabarun |
|