| Author |
Distributed transaction with MQ And DB2 using java standalone
|
iamiqbal.m Mohiuddin
Greenhorn
Joined: May 11, 2006
Posts: 12
|
|
I have a scenario where in the java standalone program reads message from MQ queue and inserts into database.
This should happen as a single unit of work.
My question is java standalone supports distributed transaction? [XA etc...]
If anoyone of you have handled this kind of scenario i woud appreciate any pointers in this direction.
Regards,
Iqbal.M
|
 |
Ajay Saxena
Ranch Hand
Joined: Nov 13, 2006
Posts: 154
|
|
|
Why do you need distributed tansactions here? You are just reading the messages from the MQ,and then persisting them in a DB. There's no publishing of messages happening here.Is there really any problem if your standalone java app is able to read a message from the MQ,but fails to persist it in the DB. Data integrity is not compromised here.So why do you need distributed transactions at all?
|
 |
iamiqbal.m Mohiuddin
Greenhorn
Joined: May 11, 2006
Posts: 12
|
|
After reading the message from MQ if insertion fails then message must be rolled back to Queue.
Another possibility is that based on the message the business logic would require to connect to database and get some more fields and then insert into another database. All this happens as a single unit of work.
Let me know is this not distrubuted transactions.
I am looking for both 1) reading from MQ and inserting into DB
2) Reading from DB and inserting into another DB.
Thanks in advance.
|
 |
Ajay Saxena
Ranch Hand
Joined: Nov 13, 2006
Posts: 154
|
|
|
I'm not sure about 1>. But 2> certainly qualifies as a distributed txn. XA is a set of JEE specs for distributed txns. You need to have an implementation for the same to configure a dist transactional setup.
|
 |
 |
|
|
subject: Distributed transaction with MQ And DB2 using java standalone
|
|
|