Implementing two phase commit with DB2 API. 
Author Message
 Implementing two phase commit with DB2 API.

Hi,

    I will directly get to the point, using DB2's API how can I issue a
prepare to commit statement, followed either by a confirmation or
cancelation of the previously prepared transaction.

    The context is the following; I wrote a program that applies the two
phase commit model on a relational database and other data sources. The
other data sources are not necessarily a relational database (it could be a
COM / CORBA transaction, third party product, etc...). These data sources
are just required to provide the two phase commit model.

    In short, I wrote a lite model of a transaction manager (like
TUXEDO,ENCICA) specifically for our software.

    I am aware of IBM products such as Datajoiner, DB2 Connect (DRDA), and
DDCS and others from third parties that allows to connect to several
databases (and not necessarily DB2 databases) and will manage the two phase
commit process.

    However, I am still left with the non relational data sources as well as
the relational databases that are not supported with these products.

    What I need is a DB2 API function that would allow me to issue a prepare
to commit followed either by a commit or rollback.

    I know the DB2 API functions to manage an indoubt transaction for a DB2
database (sqlxhqry - list an indoubt transaction, sqlxhcom - to commit an
indoubt transaction, sqlxhrol - to rollback an indoubt transaction and
sqlxfrg - to forget a indoubt transaction).

    However, these functions are useful in terms of administrating an
indoubt transaction usually afterwards a abnormal termination (or during an
extremely long database session).

P.S. :

    I know it is possible, since several X-OPEN compliant transaction
managers have successfully implemented it for DB2 databases.

    However, most of our clients do not use one of these X-OPEN compliant
transaction managers. Therefore X-OPEN solutions are not applicable in my
case.

--
Steven Belbin
R&D Consultant
Consyst-SQL



Fri, 22 Jun 2001 03:00:00 GMT
 Implementing two phase commit with DB2 API.

Steven, DB2 products (DB2 UDB, DB2 Connect) implement X/Open XA API to allow
TP monitor vendors and programmers like yourself to implement 2-phase commit
function. In the world of XA DB2 products will assume the role of a XA
Resource Manager (RM) and your code (or CICS, Encina, MTS, Tuxedo, MQ Series
etc. ) assume the role of a Transaction Manager.

It seems to me that you are attempting to develop your own transaction
manager which would work with DB2 databases as one RM and other resources
also participating as RMs in a distributed transaction. If that is what you
want to do then you should obtain a copy of the X/Open XA specification. It
will provide the description of the API that you require.

PS. Why did you decide to write your own TM when so many good (and some free
e.g. MTS) TMs are out there on hte market?


Quote:
>Hi,

>    I will directly get to the point, using DB2's API how can I issue a
>prepare to commit statement, followed either by a confirmation or
>cancelation of the previously prepared transaction.

>    The context is the following; I wrote a program that applies the two
>phase commit model on a relational database and other data sources. The
>other data sources are not necessarily a relational database (it could be a
>COM / CORBA transaction, third party product, etc...). These data sources
>are just required to provide the two phase commit model.

>    In short, I wrote a lite model of a transaction manager (like
>TUXEDO,ENCICA) specifically for our software.

>    I am aware of IBM products such as Datajoiner, DB2 Connect (DRDA), and
>DDCS and others from third parties that allows to connect to several
>databases (and not necessarily DB2 databases) and will manage the two phase
>commit process.

>    However, I am still left with the non relational data sources as well
as
>the relational databases that are not supported with these products.

>    What I need is a DB2 API function that would allow me to issue a
prepare
>to commit followed either by a commit or rollback.

>    I know the DB2 API functions to manage an indoubt transaction for a DB2
>database (sqlxhqry - list an indoubt transaction, sqlxhcom - to commit an
>indoubt transaction, sqlxhrol - to rollback an indoubt transaction and
>sqlxfrg - to forget a indoubt transaction).

>    However, these functions are useful in terms of administrating an
>indoubt transaction usually afterwards a abnormal termination (or during an
>extremely long database session).

>P.S. :

>    I know it is possible, since several X-OPEN compliant transaction
>managers have successfully implemented it for DB2 databases.

>    However, most of our clients do not use one of these X-OPEN compliant
>transaction managers. Therefore X-OPEN solutions are not applicable in my
>case.

>--
>Steven Belbin
>R&D Consultant
>Consyst-SQL




Sat, 23 Jun 2001 03:00:00 GMT
 Implementing two phase commit with DB2 API.

Also, once you are familiarised with the X/OPEN XA APIs, please see the DB2 Admin Guide V5.2 Section

2 Distributed Transactions, Chapter 9 (??) Using DB2 with an XA Compliant Transaction Manager. This
describes
how to obtain DB2 UDB's XA switch structure.

Quote:

> Steven, DB2 products (DB2 UDB, DB2 Connect) implement X/Open XA API to allow
> TP monitor vendors and programmers like yourself to implement 2-phase commit
> function. In the world of XA DB2 products will assume the role of a XA
> Resource Manager (RM) and your code (or CICS, Encina, MTS, Tuxedo, MQ Series
> etc. ) assume the role of a Transaction Manager.

> It seems to me that you are attempting to develop your own transaction
> manager which would work with DB2 databases as one RM and other resources
> also participating as RMs in a distributed transaction. If that is what you
> want to do then you should obtain a copy of the X/Open XA specification. It
> will provide the description of the API that you require.

> PS. Why did you decide to write your own TM when so many good (and some free
> e.g. MTS) TMs are out there on hte market?



> >Hi,

> >    I will directly get to the point, using DB2's API how can I issue a
> >prepare to commit statement, followed either by a confirmation or
> >cancelation of the previously prepared transaction.

> >    The context is the following; I wrote a program that applies the two
> >phase commit model on a relational database and other data sources. The
> >other data sources are not necessarily a relational database (it could be a
> >COM / CORBA transaction, third party product, etc...). These data sources
> >are just required to provide the two phase commit model.

> >    In short, I wrote a lite model of a transaction manager (like
> >TUXEDO,ENCICA) specifically for our software.

> >    I am aware of IBM products such as Datajoiner, DB2 Connect (DRDA), and
> >DDCS and others from third parties that allows to connect to several
> >databases (and not necessarily DB2 databases) and will manage the two phase
> >commit process.

> >    However, I am still left with the non relational data sources as well
> as
> >the relational databases that are not supported with these products.

> >    What I need is a DB2 API function that would allow me to issue a
> prepare
> >to commit followed either by a commit or rollback.

> >    I know the DB2 API functions to manage an indoubt transaction for a DB2
> >database (sqlxhqry - list an indoubt transaction, sqlxhcom - to commit an
> >indoubt transaction, sqlxhrol - to rollback an indoubt transaction and
> >sqlxfrg - to forget a indoubt transaction).

> >    However, these functions are useful in terms of administrating an
> >indoubt transaction usually afterwards a abnormal termination (or during an
> >extremely long database session).

> >P.S. :

> >    I know it is possible, since several X-OPEN compliant transaction
> >managers have successfully implemented it for DB2 databases.

> >    However, most of our clients do not use one of these X-OPEN compliant
> >transaction managers. Therefore X-OPEN solutions are not applicable in my
> >case.

> >--
> >Steven Belbin
> >R&D Consultant
> >Consyst-SQL


--
David Marvin
DRDA & DUOW Development
DB2 Universal Database & DB2 Connect
IBM Toronto Laboratory

DB2 product information at http://www.software.ibm.com/data/db2/
DB2 product  support    at http://www.software.ibm.com/data/db2/library/
DB2 produc publications at http://www.software.ibm.com/data/db2/library/ and follow link
DB2 performance reports at http://www.software.ibm.com/data/db2/performance/

  vcard.vcf
< 1K Download


Mon, 25 Jun 2001 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. DB2 Connect two phase commit

2. two phase commit

3. Two phase commit?

4. Replication and two phase commit?

5. Two-phase-commit approach

6. Two-phase commit

7. Weird Two-phase commit question

8. Two phase commit between Oracle8i and MSSQL 7.0 Problem

9. Two Phase Commit

10. two-phase commit

11. Two Phase Commit support

12. two-phase commits


 
Powered by phpBB® Forum Software