Forums Register Login

MDB does not rollback

+Pie Number of slices to send: Send
Hi,
I am MDB with container transaction, my MDB invoke when any message come in queue ,I process the message and insert the record in DB after inserting in DB I call another method to get some other detail from DB,this is throwing exception .
all transaction happening in onMessage();
I want if any exception occurs then it should roll back and there should not be any record in DB.

But it is not happening like that it is not removing inserted record from DB.

pl solve my problem

Thanks
Manish
+Pie Number of slices to send: Send
Manish,
can you post your code?

I tried out something simple:



and the ship is not getting persisted, so the transaction is actually being rolled back; are you catching the exception? Is it a RuntimeExcpetion?

Alejandro
+Pie Number of slices to send: Send
Hi Manish,
On the top of words said by 'Alejandro' I would like say you please check Tx attribute,if you are calling another EJB component.
Make it sure that all other component doesn't have Require-New attribute. If that is the case than this situation can come.

Cheers,
Sunil Dixit
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1099 times.
Similar Threads
Two transactions in one CMP MDB
EJB timeout issue
MDB does not rollback
Journal Article - Asynchronous queries in J2EE
MDB Message Redelivery and discard
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:34:36.