Author |
Message
|
archit_agarwal |
Posted: Sat Jan 14, 2006 8:08 am Post subject: Implementing Two Phase commit using MQ Client |
|
|
Novice
Joined: 14 Jan 2006 Posts: 16
|
Hi All,
This is the topic which might have been discussed several times, but still I am unable to find the proper soln.
I want to implement 2 phase commit at the client end(linux machine) where MQ Client has been installed and Oracle server is running. I have a Java program that reads from the MQ and inserts the message in the Oracle table.
As there are two resources (MQ and Oracle) are involved I want to insure that my transactions will commit in one UOW.
Please guide me.. Thanks in advance.
Rgds,
Archit Agarwal |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 14, 2006 8:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You either need an MQ Server or the transactional client (same cost).
If you can execute the transaction on the machine having the MQ Server you are better off.
Read the manuals they will guide you (programming manual).
You are talking only about 2 resources but you are not specifying where the Transaction Manager will be.
The easiest would be a multiphase commit orchestrated by a J2EE compliant TM. But then that is just my opinion. If you do not have a J2EE TM at hand you can have MQ manage the transaction. Additional set up is needed. Read the manuals...(admin)
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mvic |
Posted: Sat Jan 14, 2006 2:29 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
fjb_saper wrote: |
The easiest would be a multiphase commit orchestrated by a J2EE compliant TM. But then that is just my opinion. |
MQBEGIN (and therefore the Java equivalent qmgr.begin()) is still valid for server bindings only. Therefore to use MQ as the TM, the app must be on the same machine as the qmgr. If the app must be remote from the qmgr, then fjb_saper's suggestion to use J2EE is probably the only possibility. |
|
Back to top |
|
 |
archit_agarwal |
Posted: Sat Jan 14, 2006 10:19 pm Post subject: |
|
|
Novice
Joined: 14 Jan 2006 Posts: 16
|
Thanx for the reply. I regret for incomplete information.
I have few restrictions for the implementations.
I cannot use MQ Server reason is the cost and the architecture already proposed to client, which to get modify at this time is really difficult.
I have the option of using Extended Transactional Client but then MQ Queue Manager cannot act as Transaction co-ordinator. It will only help the MQ to participate in 2 phase commit.
I know how to configure MQ Queue Manager to act as Transaction co-ordinator.
Just a thought, Does Oracle itself cannot act as a Transaction manager to co-ordinate 2 phase commit between MQ and Oracle database. I tried to find, but no luck. (As DB2 can act as a transaction co-ordinator for MQ and DB2 database. and DB2 also provides the APIs for the same.)
fjb_saper, what do exactly meant by "J2EE compliant TM". Does that mean to use some Application server as the Transaction Manager?
If it is so, I cannot use free application server like tomcat. I have to use WAS, if i decided to go for J2EE implementation, which will again have cost impact to client or to us.
Please guide me.
Thanks & Rgds,
Archit |
|
Back to top |
|
 |
EddieA |
Posted: Sun Jan 15, 2006 12:13 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
I cannot use MQ Server reason is the cost |
But you then say:
Quote: |
I have the option of using Extended Transactional Client |
But my understanding is, that the Transactional Client costs the same as a full MQ Server.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
archit_agarwal |
Posted: Sun Jan 15, 2006 12:30 am Post subject: |
|
|
Novice
Joined: 14 Jan 2006 Posts: 16
|
Edie you are correct, both cost same but the architecture thats already proposed to the client does have only one server license and also, we have number of license for Extended transactional client but only one license for MQ Server. Hope I made the point clear.
Thanks & Regards,
Archit Agarwal |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jan 15, 2006 10:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looking at WAS 6.0 you have additionnal possibilities:
a) define a service integration Bus
b) define a WAS default messaging engine with DB as persistency engine
c) put the msg engine as a member on the bus
d) define a foreign bus as MQ-Link between MQ and Was messaging engine
You can now access the BUS's messaging engine from any WAS that participates in the BUS scope, and by the same token access the MQ network.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
archit_agarwal |
Posted: Sun Jan 15, 2006 10:21 pm Post subject: |
|
|
Novice
Joined: 14 Jan 2006 Posts: 16
|
Hi,
Thanks for the concern, well i was aware of the WAS 6.0 feature, but if you look my problem, then thats not the feasible solution to the problem. This time we cannot ask to the client for bearing addditional cost for either WAS or either MQ Server.
-Is there any way I can handle 2 phase commit in Oracle (&MQ Client)?
-Can I use Oracle Application server in any scenario and if yes, then how?
-If 2 phase commit is not possible then What would be the possible ways of achieving the data integrity and preventing message loss?
Thx in advance
Archit |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 16, 2006 6:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You might be able to do your 2pc with the Oracle messaging, and bridge that to MQ using an MQClient.
Other than that, you have to use non-XA coordinated transactions. This makes for a bit of room for errors. OAS might be something that would coordinate these transactions for you, so that you don't have to write the logic yourself.
You'll have to evaluate the costs of the potential errors against the cost of an MQServer license, and decide which one is cheaper in the long run. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|