Automatically retry EJB method call in JBoss EAP

Solution Unverified - Updated -

Issue

We have some ejb methods that we would like to retry automatically if there are certain exceptions (eg org.hibernate.ObjectNotFoundException) during the execution of these methods.  Typically this is caused by phantom reads, when concurrently a database record is deleted and committed in another transaction, and typically if we then just retry the method call completely, running in a new transaction, everything will be ok.  Is there some standard way to achieve this in jboss or should we write a custom interceptor?

Environment

Red Hat JBoss Enterprise Application Platform (EAP)

  • 5.x
  • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.