Model example broken on AS7: Could not commit transaction.
----------------------------------------------------------
Key: SEAMREMOTING-41
URL:
https://issues.jboss.org/browse/SEAMREMOTING-41
Project: Seam Remoting
Issue Type: Bug
Environment: Seam Remoting 3.0.1-SNAPSHOT (2011-07-15)
Seam Persistence 3.0.1-SNAPSHOT (2011-07-11)
JBoss AS 7.1.0-Alpha1-SNAPSHOT (2011-07-14)
Firefox 3.6.18
Reporter: Marek Schmidt
Assignee: Marek Schmidt
After updating Seam Persistence to the 3.0.1-SNAPSHOT, which contains the fix for
SEAMREMOTING-40, the Model example is still broken,
Attemting to enter a new person leads to an "Could not commit transaction."
error with the following exception in the server logs:
{quote}
17:11:23,283 INFO [org.jboss.as.server.controller] (pool-2-thread-4) Deployed
"remoting-model.war"
17:11:48,769 INFO [stdout] (http--127.0.0.1-8080-2) Hibernate: select person0_.personId
as personId18_, person0_.dateOfBirth as dateOfBi2_18_, person0_.firstName as firstName18_,
person0_.lastName as lastName18_ from Person person0_
17:11:48,831 INFO [stdout] (http--127.0.0.1-8080-2) Hibernate: select
addresses0_.PERSON_ID as PERSON7_18_1_, addresses0_.addressId as addressId1_,
addresses0_.addressId as addressId19_0_, addresses0_.country as country19_0_,
addresses0_.PERSON_ID as PERSON7_19_0_, addresses0_.postCode as postCode19_0_,
addresses0_.streetName as streetName19_0_, addresses0_.streetNo as streetNo19_0_,
addresses0_.suburb as suburb19_0_ from Address addresses0_ where addresses0_.PERSON_ID=?
17:11:48,842 INFO [stdout] (http--127.0.0.1-8080-2) Hibernate: select
addresses0_.PERSON_ID as PERSON7_18_1_, addresses0_.addressId as addressId1_,
addresses0_.addressId as addressId19_0_, addresses0_.country as country19_0_,
addresses0_.PERSON_ID as PERSON7_19_0_, addresses0_.postCode as postCode19_0_,
addresses0_.streetName as streetName19_0_, addresses0_.streetNo as streetNo19_0_,
addresses0_.suburb as suburb19_0_ from Address addresses0_ where addresses0_.PERSON_ID=?
17:11:58,794 INFO [stdout] (http--127.0.0.1-8080-3) Hibernate: call next value for
hibernate_sequence
17:11:58,817 INFO [stdout] (http--127.0.0.1-8080-3) Hibernate: insert into Person
(dateOfBirth, firstName, lastName, personId) values (?, ?, ?, ?)
17:11:58,823 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(http--127.0.0.1-8080-3) SQL Error: 23001, SQLState: 23001
17:11:58,823 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(http--127.0.0.1-8080-3) Unique index or primary key violation: "PRIMARY_KEY_8 ON
PUBLIC.PERSON(PERSONID)"; SQL statement:
insert into Person (dateOfBirth, firstName, lastName, personId) values (?, ?, ?, ?)
[23001-145]
17:11:58,825 WARN [com.arjuna.ats.arjuna] (http--127.0.0.1-8080-3) ARJUNA12125:
TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple<
0:ffff7f000001:-5afc66c2:4e205886:8,
org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@2ce6a73d
>: javax.persistence.PersistenceException:
org.hibernate.exception.ConstraintViolationException: Unique index or primary key
violation: "PRIMARY_KEY_8 ON PUBLIC.PERSON(PERSONID)"; SQL statement:
insert into Person (dateOfBirth, firstName, lastName, personId) values (?, ?, ?, ?)
[23001-145]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1344)
[hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1277)
[hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1283)
[hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1454)
[hibernate-entitymanager-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:54)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:97)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:274)
at
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:94)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:159)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1158)
at
com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:119)
at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:61)
[seam-persistence-3.0.1-20110711.040751-17.jar:]
at
org.jboss.seam.transaction.DefaultSeamTransaction.commit(DefaultSeamTransaction.java:92)
[seam-persistence-3.0.1-20110711.040751-17.jar:]
at org.jboss.seam.transaction.Work.workInTransaction(Work.java:56)
[seam-persistence-3.0.1-20110711.040751-17.jar:]
at
org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:148)
[seam-persistence-3.0.1-20110711.040751-17.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at
org.jboss.interceptor.proxy.InterceptorInvocation$InterceptorMethodInvocation.invoke(InterceptorInvocation.java:72)
[jboss-interceptor-core-2.0.0.Alpha3.jar:2.0.0.Alpha3]
at
org.jboss.interceptor.proxy.SimpleInterceptionChain.invokeNextInterceptor(SimpleInterceptionChain.java:82)
[jboss-interceptor-core-2.0.0.Alpha3.jar:2.0.0.Alpha3]
at
org.jboss.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:133)
[jboss-interceptor-core-2.0.0.Alpha3.jar:2.0.0.Alpha3]
at
org.jboss.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:112)
[jboss-interceptor-core-2.0.0.Alpha3.jar:2.0.0.Alpha3]
at
org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:65)
[weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
at
org.jboss.seam.remoting.examples.model.-2125363893$Proxy$_$$_WeldSubclass.savePerson(-2125363893$Proxy$_$$_WeldSubclass.java)
[classes:]
at
org.jboss.seam.remoting.examples.model.PersonAction$Proxy$_$$_WeldClientProxy.savePerson(PersonAction$Proxy$_$$_WeldClientProxy.java)
[classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.seam.remoting.Call.execute(Call.java:170)
[seam-remoting-3.0.1-20110705.040935-11.jar:]
at org.jboss.seam.remoting.model.ModelHandler.processApplyRequest(ModelHandler.java:267)
[seam-remoting-3.0.1-20110705.040935-11.jar:]
at org.jboss.seam.remoting.model.ModelHandler.handle(ModelHandler.java:83)
[seam-remoting-3.0.1-20110705.040935-11.jar:]
at org.jboss.seam.remoting.Remoting.service(Remoting.java:255)
[seam-remoting-3.0.1-20110705.040935-11.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
[jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at
org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:67)
[weld-core-1.1.2.AS7.jar:2011-07-06 12:26]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
[jboss-as-web-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
at
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49)
[jboss-as-jpa-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)
[jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_24]
Caused by: org.hibernate.exception.ConstraintViolationException: Unique index or primary
key violation: "PRIMARY_KEY_8 ON PUBLIC.PERSON(PERSONID)"; SQL statement:
insert into Person (dateOfBirth, firstName, lastName, personId) values (?, ?, ?, ?)
[23001-145]
at org.hibernate.exception.internal.SQLStateConverter.convert(SQLStateConverter.java:104)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:131)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:80)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at $Proxy96.executeUpdate(Unknown Source) at
org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:56)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2495)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2931)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:80)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:273)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:265)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:186)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1174)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:399)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
at
org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
... 48 more
Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation:
"PRIMARY_KEY_8 ON PUBLIC.PERSON(PERSONID)"; SQL statement:
insert into Person (dateOfBirth, firstName, lastName, personId) values (?, ?, ?, ?)
[23001-145]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:158)
at org.h2.index.TreeIndex.add(TreeIndex.java:56)
at org.h2.table.RegularTable.addRow(RegularTable.java:125)
at org.h2.command.dml.Insert.insertRows(Insert.java:126)
at org.h2.command.dml.Insert.update(Insert.java:86)
at org.h2.command.CommandContainer.update(CommandContainer.java:69)
at org.h2.command.Command.executeUpdate(Command.java:201)
at
org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:143)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
at
org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at
org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:124)
[hibernate-core-4.0.0.Beta1.jar:4.0.0.Beta1]
... 62 more
{quote}
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira