0 Replies Latest reply on Jun 21, 2012 3:10 PM by Rasto Cesnek

    AS 7.1.1 final strange TX behavior after runtime exception

    Rasto Cesnek Newbie



      I am experiencing strange transaction behavior after a bean throws a java.security.AccessControlException which is a RuntimeException.


      Basically, a business method throws AccessControlException and while the stack unwinds through the various JBoss infrastructure interceptors towards the calling "client" bean, I can see that the transaction goes from state

      TransactionImple < ac, BasicAction: 0:ffffac100002:-2ee2aa6d:4fe35b7a:da status: ActionStatus.RUNNING >

      to state

      TransactionImple < ac, BasicAction: 0:ffffac100002:-2ee2aa6d:4fe35b7a:da status: ActionStatus.ABORT_ONLY >


      Afterwards, any calls to e.g. to em.persist(...) within this transaction scope fail as the TransactionScopedEntityManager.transactionIsRequired() does throw TransactionrequiredException.


      Caused by: javax.persistence.TransactionRequiredException: JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)

                at org.jboss.as.jpa.container.AbstractEntityManager.transactionIsRequired(AbstractEntityManager.java:692) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.jpa.container.AbstractEntityManager.persist(AbstractEntityManager.java:562) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]


      Is this an appropriate behavior? I guess that according to the spec the transaction should be marked for rollabck but the unit of work actually should be able to continue although the only possible outcome will be roll back in the end.


      I found an issue https://issues.jboss.org/browse/JBAS-7195  where I guess something simillar is described. Does this also hold for JBoss 7.1.1 final or is this perhaps another issue?