4 Replies Latest reply on Mar 4, 2004 5:54 AM by kwk_kwk

    Classes - heirs RuntimeException is not rollback transaction

    kwk_kwk

      I have a class-heir of RuntimeException

      public class ApplicationException extends RuntimeException implements Serializable { ... }

      All my Stateless EJB throw ApplicationException when any error occurs.
      I try execute method (with transaction Required attibute) with two inserts into DB. Error occurs during second insert execution. When error occurs I catch it and throw ApplicationException. Following by J2EE Spec. EJB container must rollback transaction, but in my case container does not do it. I tried to throw RuntimeException or EJBException - both work right. But with custom exception - heir RuntimeException container works wrong.
      Also I notice one detail: when RuntimeException or EJBException occurs container writes stack trace into console log without my assistance, but in case with ApplicationException no stack trace placed into console log.

      This case also take place in Jboss 3.0.0 and 3.0.4