Uploaded image for project: 'Hibernate Integration'
  1. Hibernate Integration
  2. HIBERNATE-122

JBTM believe Hibernate rollsback/throws Exception in wrong order

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Rejected
    • Labels:
      None

      Description

      Hi guys,

      I am logging this as a 'critical' priority because it is one of those issues that 'falls between the gaps' and I need someone to take ownership of it.

      As reported in JBTM-575, since JBoss 4.x the AS has stopped properly reporting JPA errors. It used to properly report the cause, but now in many situations it simply says 'setRollbackOnly called from'. The original exception is not contained as part of Exception.getCause(). It some cases the original Exception is not even output in the logs. This makes debugging extremely difficult.

      The JBTM team believe their implementation is correct, but that Hibernate's AbstractEntityManagerImpl is at fault. Specifically, Hibernate does...

      public void throwPersistenceException(PersistenceException e) {
      ...
      markAsRollback();
      throw e;
      }

      ...and the JBTM team say "What's key here is that, from the transaction manager's perspective, the setRollbackOnly call precedes the exception - hibernate sets the tx to rollback before throwing the exception... you basically want [JBTM] to put in a workaround to resequence the events back into causal order after hibernate has messed them up. I'm not going to do that, because it will have the side effect of..."

      As an outsider, I cannot say whether JBTM or Hibernate is truly at fault, but I would dearly like to see this resolved.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sebersole Steve Ebersole
                  Reporter:
                  kennardconsulting Richard Kennard
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: