2 Phase commit

About CICS and BMS - In this Mainframe Forum - You can post your queries on CICS

Moderators: DikDude, Natarajan, Moderator Group

Post Reply
156138
Member
Posts: 15
Joined: Tue Aug 29, 2006 7:27 pm
Location: Chennai

2 Phase commit

Post by 156138 » Fri Nov 24, 2006 8:25 pm

What is 2 phase commit??
Regards,
Vinod Reddy.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sat Nov 25, 2006 4:41 pm

Probably the best definition I have found is in the IBM Redbook:
Systems Programmer?s Guide to Resource Recovery Services (RRS).

Go to IBM Library and look at the redbooks section. sorry, I don't have the link.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
Krishna
Site Admin
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

Two-phase commit

Post by Krishna » Mon Nov 27, 2006 11:10 am

Two-phase commit:

Coordinator sends requests to all participants for vote. All commit votes only result in global commit. Any single vote for abort will result in global abort.


Detailed Definition for two-phase commit
---------------------------------------------------


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,
Krishna
www.geocities.com/srcsinc
www.ibmmainframeguru.com
www.jacharya.com

User avatar
kalva
Member
Posts: 4
Joined: Thu Nov 16, 2006 10:11 am

About Two phase commit

Post by kalva » Mon Nov 27, 2006 5:05 pm

This is maily the concept of updating multiple database.

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.

Hit or browse the following link to know more in detail with diagram(Good example).

http://publib.boulder.ibm.com/infocente ... 005032.htm

Venkat
Venkat Ram Reddy Kalva

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others