This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes MDB deadlock - how to solve it? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MDB deadlock - how to solve it?" Watch "MDB deadlock - how to solve it?" New topic

MDB deadlock - how to solve it?

Baba Bizlowsky
Ranch Hand

Joined: Dec 15, 2003
Posts: 39
Hi everybody.

I have a simple message-driven bean which has a simple task - get a message, extract some data and store it in the database.

Everything works smoothly until an exception is thrown - for instance, the column in the database table is too small to fit a String. As a result I get a deadlock, since the MDB doesn't eat the message but instead puts it back into the queue, gets it again, throws exception, puts it back etc.

How do I get rid of this? Better said, what do I need to put in DD or the code so that MDB eats the message instead of putting it back?

Thanks in advance for any kind of help. Cheers!
Damanjit Kaur
Ranch Hand

Joined: Oct 18, 2004
Posts: 346
Message acknowledgement is part of transaction in CMT MDB. if its rolled back, message is not acknowledged by container and thus redelivered. So using 'Not Supported' attribute for transaction for MDB may work or let the MDB be BMT.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: MDB deadlock - how to solve it?
It's not a secret anymore!