Posted: Wed Dec 05, 2007 8:43 am Post subject: MDB backout queue
Voyager
Joined: 05 Aug 2002 Posts: 79 Location: US
Hi,
I'm using a Message Driven Bean with Bean managed transaction (as per our standard) and I use a non-XA datasource (simple Datasource) to log the message to a Database (There is no way we can use XADatasource and container managed Transaction on the bean ).
Now, once I get the message I have to do multiple table updates/inserts and if there is an error doing these db operations, the message has to be backed out to the Backout queue.
Will there be any issues if I open a new session for the backout queue JMSSender from the MDB and put the message there and commit the session? Or what is the correct way of doing it, I want my db operations to be rolled back but the JMSSender (to backout queue) to be committed if any db issue occurs while logging the message.
Well you do not specify your environment (i.e. app server)
Assuming the App server is IBM WAS all you need to do is specify backout threshold and backout queue on the local queue and raise the appropriate exception in your MDB when you had a problem on the DB.
Set the MDB's onMessage method as transactional: requires new
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum