[jboss-user] [EJB 3.0] - org.jbos.tm.jbossrollbackexception instead of EJBException

judge2005 do-not-reply at jboss.com
Tue Apr 3 17:20:42 EDT 2007


Hi,

Under certain circumstances (vague I know but hopefully someone may have an answer before I try and cobble together a reproducible test case) I get a org.jboss.tm.JBossRollbackException instead of an EJBException. The basic scenario is that I have a MDB which calls a session bean. The session bean is declared to require transactions, but the MDB has no annotation specifying its transaction behavior.

The session bean performs inserts into a database using a hibernate entity manager. If I do the inserts totally via hibernate I get the EJBException. If I  let some database triggers handle some of the inserts I get a JBossRollbackException.

Anyone know what is going on?

Thanks in advance.

BTW I'm using JBoss 4.0.4GA patched with EJB3 RC9.

java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=ma2koleinik2/20, BranchQual=, localId=20] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.EntityExistsException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update)
	at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
	at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:211)
	at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:79)
	at $Proxy83.process(Unknown Source)
	at com.ftid.fisi.feeddata.listener.FeedDataMdb.onEvent(FeedDataMdb.java:46)
	at com.ftid.fisi.feeddata.listener.FeedDataMdb.onEvent(FeedDataMdb.java:18)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
	at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:111)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
	at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
	at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
	at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
	at $Proxy87.onEvent(Unknown Source)
	at com.ftid.fisi.eventmanager.connector.EventWorker.run(EventWorker.java:62)
	at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
	at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
	at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=ma2koleinik2/20, BranchQual=, localId=20] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.EntityExistsException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update)
	at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
	at org.jboss.tm.TxManager.commit(TxManager.java:240)
	at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
	... 45 more
Caused by: javax.persistence.EntityExistsException: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:616)
	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:524)
	at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
	at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
	at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
	... 47 more
Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
	at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
	at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
	at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
	at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
	at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
	at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:515)
	... 50 more
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (DHUTTON.ISSUER_NAME_UK) violated
 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034305#4034305

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034305



More information about the jboss-user mailing list