File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distributed transaction with MQ And DB2 using java standalone

 
iamiqbal.m Mohiuddin
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 154
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic