How to recover from deadlocks in Message Driven Beans in GlassFish?
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?
Have you looked at Configuring a 'retry delay' in MQ Series
What about catching the error, sleeping, and then re-throwing it?
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.
精彩评论