Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-290

EntityManager.refresh throws UnresolvableObjectException instead of EntityNotFoundException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EJB 3.0 RC3
    • EJB 3.0 RC1
    • None
    • None
    • XP pro

      Set transaction isolation to read-committed.

      1. read a persistent entity
      2. delete the row from the DB from another process
      3. refresh the entity

      The EntityManager throws:
      org.hibernate.UnresolvableObjectException: No row with the given identifier exists: ch.logobject.test.model.TaskAlloc#686796
      at org.hibernate.UnresolvableObjectException.throwIfNull(UnresolvableObjectException.java:42)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:126)
      at org.hibernate.event.def.DefaultRefreshEventListener.onRefresh(DefaultRefreshEventListener.java:39)
      at org.hibernate.impl.SessionImpl.refresh(SessionImpl.java:694)
      at org.hibernate.ejb.AbstractEntityManagerImpl.refresh(AbstractEntityManagerImpl.java:160)
      at org.jboss.ejb3.entity.InjectedEntityManager.refresh(InjectedEntityManager.java:112)

      According to the EJB3 specs the entity manager should throw a EntityNotFoundException. This should be an easy catch/wrap and rethrow fix.

              patriot1burke@gmail.com Bill Burke (Inactive)
              oglueck oglueck (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: