Hi guys,
I have a persistent JMS Q running on WLS 6.1. I have a MessageDrivenBean with an onMessage method that reads the message off the q when it arrives. I am then writing the message to file.
Myquestions.
If I am running under a container managed transaction (which i set in the creation of the Qsession, and in the ejb-jar.xml) am I correct in thinking the container automatically commits the transaction if the message is written to file with no exceptions?
More importantly, if the message is not able to be written to file I want to rollback so the transaction can be started again and the message will be redelivered and therefore not lost.
I call setRollbackOnly on the messageDrivenContext, set up when the mdb is created by the continer. But then my server/jmsQ goes into an infinte loop trying to redeliver my message to the MDB . How can I break out of this loop?
I need to reconsume this message but only after the problem - why it cannot be written to file - has been fixed. Any ideas on how to do that?
I've tried
testing to check if the messageDrivenContext has rollbackonly set, by calling getrollback only, but this fails to work!
Any help will be appreciated, my code is below:
*************************************************************