I am running into a deadlock situation when receiving messages on a pool of MDBs in GlassFish. If I receive multiple messages that concurrently try to update the same set of rows, the MDB throws a LockAcquisitionException. Unfortunately the GlassFish JMS provider redelivers the message immediately causing the same exception to occur again. I was hoping to configure the JMS provider to redeliver after some delay, but this does not seem to be supported. Any ideas on how I could solve this issue?
Asked
Active
Viewed 597 times
2 Answers
0
Have you looked at Configuring a 'retry delay' in MQ Series
What about catching the error, sleeping, and then re-throwing it?
-
Unfortunately GlassFish does not offer retry delay. Sleeping is an option, but the J2EE spec frowns upon it. – Naresh Apr 06 '11 at 23:22
0
Here's a link to some Oracle documentation on the configuration options: http://download.oracle.com/docs/cd/E19798-01/821-1794/aeooq/index.html
endpointExceptionRedeliveryAttempts
This will allow you to catch errors. You could then implement an MBean on the Fault/RME endpoint and add in artificial delays
But there doesn't appear to be a way to put a retry delay in GlassFish at this time.

Chris K
- 11,996
- 7
- 37
- 65
-
Agree. At this point I am thinking of abandoning GlassFish's native provider (OpenMQ) and going to HornetQ or ActiveMQ - both these provide more sophisticated ways of handling such scenarios (retry delays, message groups etc.). Unfortunately the road to integrating with other JMS providers is a tough one - the documentation is either dated or not very good. Failed miserably with ActiveMQ, but still trying! – Naresh Apr 06 '11 at 23:34
-
Perhaps moving to FUSE (ActiveMQ with CXF and ServiceMix) http://www.fusesource.com would be useful?? -Disclaimer, I work for Progress, which owns Fuse Source. http://weblogs.java.net/blog/bhavanishankar/archive/2007/01/servicemix_on_g_1.html (servicemix w/glassfish) Or you could just add the retry timeout logic to OpenMQ, being Open Source and all. :-) Best of luck! – Chris K Apr 07 '11 at 00:42
-