Well, if you look at the stack trace, the reason is very clear:
Caused by: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to
commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=gavin-kings-computer.local/117,
BranchQual=, localId=117] status=STATUS_NO_TRANSACTION; - nested throwable:
(javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException:
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:191)
| 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.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| at
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| 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.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
| at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| at $Proxy113.removeHotel(Unknown Source)
| at
org.jboss.seam.example.booking.HotelBooking$$FastClassByCGLIB$$c83b792d.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
| at
org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:74)
| at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
| at
org.jboss.seam.example.booking.LoggedInInterceptor.checkLoggedIn(LoggedInInterceptor.java:25)
| at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at
org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:40)
| at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at
org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:39)
| at sun.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
| at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
| at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
| at
org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
| at
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
| at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
| at
org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:83)
| at
org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:52)
| at
org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$3bf45ed2.removeHotel(<generated>)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
| ... 40 more
| Caused by: org.jboss.tm.JBossRollbackException: Unable to commit,
tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=gavin-kings-computer.local/117,
BranchQual=, localId=117] status=STATUS_NO_TRANSACTION; - nested throwable:
(javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException:
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)
| ... 94 more
| Caused by: javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
| at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:647)
| 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)
| ... 96 more
| Caused by: org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch
update
| at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
| at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
| 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:144)
| at
org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
| 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)
| ... 99 more
| Caused by: java.sql.BatchUpdateException: failed batch
| at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
| at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
| at
org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:519)
| at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
| at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
| ... 106 more
The exception occurs at transaction commit (flush) time, which means that you get whatever
exception the JBoss EJB3 container throws. In this case, it throws a RuntimeException.
(I'm not quite sure if I approve of that, but you can take that up with the EJB3 guys
in the EJB3 forum.)
if you do an explicit flush() in your remove method, the exception will be handled as you
expect.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009725#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...