Speedo Transaction remains Active into Jonas when a not deferrable constraint is violated.

View: New views
1 Messages — Rating Filter:   Alert me  

Speedo Transaction remains Active into Jonas when a not deferrable constraint is violated.

by Jérôme Besnainou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Message
Hello,
 
I'm using Speedo_1_5_0 + Jonas_4_7_4 + Oracle 9.2 + Driver Oracle 10.i
 
When a database constraint which is not deferrable is violated, the Speedo transaction never end (remains active in the Jonas Admin console : see transactionActive.gif) and a non blocking lock is created in the database (select * from v$lock where type ='TX').
If the constraint is deferrable there is no problem.
I'm using JDBC XA Ressource Adapter as Datasource (see JOnAS_jdbcOracleXA.rar (where the driver oracle is) and Mysedv_Oracle.rar where the specific configuration to the database is).
 
My Persistence Manager is correctly close.
I use default speedo config except (org.objectweb.speedo.mapperName rdb.oracle and org.objectweb.speedo.transaction.mode REQUIRED)
 
(Execution logs are at the end of the mail)
 
If I use service dbm (jonas.service.dbm.datasources) for my datasource I have the same problem in both Oracle and Postgres (8.1.3).
 
I'm giving you a simple Eclipse project which will help you to reproduice such problem. You just have to set in build.properties projectLocation, jonas.base and jonas.root. To launch it you had to run speedoexemple/builld.xml default target (it put speedoexemple.ear in your $JONAS_ROOT/apps and the jclient simpleClient.jar in ${projectLocation}/output/client).
Script to build database are provided in Documentation/scripts.
 
To run the client  : 'java -jar simpleClient.jar rmi://localhost:1099 speedo toto' where toto is the content you will insert in database.
 
 
As all our constraints are deferrable, we are not faced to that problem for our application.
 
Could you confirm that my configuration is correct and that I do not have done mistake ?
If I have not done any mistake, I think that it is a major issue for all people which use constraint not deferrable.
 
Best Regards,
 
  Jérôme
 
Log (with JOTM jta log in debug mode)
 
**********************
BEFORECOMPLETION the EJB datalayer : 'com.edifixio.exemple.datalayer.simple.SimpleDatalayerEJB@...
**********************
 
2006-09-01 10:27:34,156 : SubCoordinator.doBeforeCompletion : Synchronization sync= org.objectweb.fractal.julia.generate
d.Cc5baff4b_0@...
2006-09-01 10:27:34,156 : Current.getTransaction : threadTx.get= java.lang.ThreadLocal@...
2006-09-01 10:27:34,172 : Current.getTransaction : Transaction ret= bb14:38:0:01381fa636f35e9afd...c3c006:
2006-09-01 10:27:34,172 : Current.getTransaction : threadTx.get= java.lang.ThreadLocal@...
2006-09-01 10:27:34,172 : Current.getTransaction : Transaction ret= bb14:38:0:01381fa636f35e9afd...c3c006:
2006-09-01 10:27:34,187 : AbstractPOManager.beforeCompletion : Error during the preparation of the transaction:
java.sql.SQLException: ORA-00001: violation de contrainte unique (SQ_MAINTAIN.UNIQUE_SIMPLE)
 
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
        at org.objectweb.jonas.resource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:775)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.insertSIMPLE0Table(SimpleMapping.java:941)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.write(SimpleMapping.java:481)
        at com.edifixio.exemple.datalayer.jdo.simple.Simple.write(Simple.java:137)
        at org.objectweb.speedo.mapper.lib.JormStorageManager.write(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cd7b897dd_0.write(INTERFACE[StorageManager])
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepareWS(TransactionalPersistenceM
anagerImpl.java:344)
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepare(TransactionalPersistenceMan
agerImpl.java:1315)
        at org.objectweb.fractal.julia.generated.Cc4304444_0.prepare(INTERFACE[TransactionalPersistenceManager])
        at org.objectweb.speedo.pm.lib.AbstractPOManager.beforeCompletion(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cc5baff4b_0.beforeCompletion(INTERFACE[JDOPOManagerItf])
        at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1520)
        at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:433)
        at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:248)
        at org.objectweb.jotm.Current.commit(Current.java:526)
        at org.objectweb.jonas_ejb.container.JFactory.postInvoke(JFactory.java:653)
        at org.objectweb.jonas_ejb.container.JStatefulFactory.postInvoke(JStatefulFactory.java:154)
        at org.objectweb.jonas_ejb.container.JSessionLocal.postInvoke(JSessionLocal.java:183)
        at org.objectweb.jonas_gen.com.edifixio.exemple.datalayer.simple.JOnASSimpleDatalayerEJB_743348403Local.add(JOnA
SSimpleDatalayerEJB_743348403Local.java:61)
        at com.edifixio.exemple.service.simple.SimpleServiceEJB.add(SimpleServiceEJB.java:59)
        at org.objectweb.jonas_gen.com.edifixio.exemple.service.simple.JOnASSimpleServiceEJB293584909Remote.add(JOnASSim
pleServiceEJB293584909Remote.java:56)
        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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
        at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:143)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:595)
2006-09-01 10:27:34,187 : JFactory.postInvoke : Could not commit transaction:org.objectweb.speedo.api.SpeedoRuntimeExcep
tion:
2006-09-01 10:27:34,187 : JFactory.postInvoke : ejbexception:
javax.ejb.EJBException: Container exception
        at org.objectweb.jonas_ejb.container.JFactory.postInvoke(JFactory.java:672)
        at org.objectweb.jonas_ejb.container.JStatefulFactory.postInvoke(JStatefulFactory.java:154)
        at org.objectweb.jonas_ejb.container.JSessionLocal.postInvoke(JSessionLocal.java:183)
        at org.objectweb.jonas_gen.com.edifixio.exemple.datalayer.simple.JOnASSimpleDatalayerEJB_743348403Local.add(JOnA
SSimpleDatalayerEJB_743348403Local.java:61)
        at com.edifixio.exemple.service.simple.SimpleServiceEJB.add(SimpleServiceEJB.java:59)
        at org.objectweb.jonas_gen.com.edifixio.exemple.service.simple.JOnASSimpleServiceEJB293584909Remote.add(JOnASSim
pleServiceEJB293584909Remote.java:56)
        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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
        at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:143)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.objectweb.speedo.api.SpeedoRuntimeException:
        at org.objectweb.speedo.pm.lib.AbstractPOManager.beforeCompletion(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cc5baff4b_0.beforeCompletion(INTERFACE[JDOPOManagerItf])
        at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1520)
        at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:433)
        at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:248)
        at org.objectweb.jotm.Current.commit(Current.java:526)
        at org.objectweb.jonas_ejb.container.JFactory.postInvoke(JFactory.java:653)
        ... 17 more
Caused by: java.sql.SQLException: ORA-00001: violation de contrainte unique (SQ_MAINTAIN.UNIQUE_SIMPLE)
 
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
        at org.objectweb.jonas.resource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:775)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.insertSIMPLE0Table(SimpleMapping.java:941)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.write(SimpleMapping.java:481)
        at com.edifixio.exemple.datalayer.jdo.simple.Simple.write(Simple.java:137)
        at org.objectweb.speedo.mapper.lib.JormStorageManager.write(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cd7b897dd_0.write(INTERFACE[StorageManager])
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepareWS(TransactionalPersistenceM
anagerImpl.java:344)
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepare(TransactionalPersistenceMan
agerImpl.java:1315)
        at org.objectweb.fractal.julia.generated.Cc4304444_0.prepare(INTERFACE[TransactionalPersistenceManager])
        ... 24 more
############### Speedo: Caught exception in SimpleServiceEJB.add: Container exception
2006-09-01 10:27:34,187 : JFactory.postInvoke : system exception in business method:
javax.ejb.EJBException: Container exception
        at org.objectweb.jonas_ejb.container.JFactory.postInvoke(JFactory.java:672)
        at org.objectweb.jonas_ejb.container.JStatefulFactory.postInvoke(JStatefulFactory.java:154)
        at org.objectweb.jonas_ejb.container.JSessionLocal.postInvoke(JSessionLocal.java:183)
        at org.objectweb.jonas_gen.com.edifixio.exemple.datalayer.simple.JOnASSimpleDatalayerEJB_743348403Local.add(JOnA
SSimpleDatalayerEJB_743348403Local.java:61)
        at com.edifixio.exemple.service.simple.SimpleServiceEJB.add(SimpleServiceEJB.java:59)
        at org.objectweb.jonas_gen.com.edifixio.exemple.service.simple.JOnASSimpleServiceEJB293584909Remote.add(JOnASSim
pleServiceEJB293584909Remote.java:56)
        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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
        at org.objectweb.carol.rmi.jrmp.server.JUnicastServerRef.dispatch(JUnicastServerRef.java:143)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.objectweb.speedo.api.SpeedoRuntimeException:
        at org.objectweb.speedo.pm.lib.AbstractPOManager.beforeCompletion(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cc5baff4b_0.beforeCompletion(INTERFACE[JDOPOManagerItf])
        at org.objectweb.jotm.SubCoordinator.doBeforeCompletion(SubCoordinator.java:1520)
        at org.objectweb.jotm.SubCoordinator.commit_one_phase(SubCoordinator.java:433)
        at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:248)
        at org.objectweb.jotm.Current.commit(Current.java:526)
        at org.objectweb.jonas_ejb.container.JFactory.postInvoke(JFactory.java:653)
        ... 17 more
Caused by: java.sql.SQLException: ORA-00001: violation de contrainte unique (SQ_MAINTAIN.UNIQUE_SIMPLE)
 
        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
        at org.objectweb.jonas.resource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:775)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.insertSIMPLE0Table(SimpleMapping.java:941)
        at com.edifixio.exemple.datalayer.jdo.simple.SimpleMapping.write(SimpleMapping.java:481)
        at com.edifixio.exemple.datalayer.jdo.simple.Simple.write(Simple.java:137)
        at org.objectweb.speedo.mapper.lib.JormStorageManager.write(Unknown Source)
        at org.objectweb.fractal.julia.generated.Cd7b897dd_0.write(INTERFACE[StorageManager])
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepareWS(TransactionalPersistenceM
anagerImpl.java:344)
        at org.objectweb.perseus.persistence.lib.TransactionalPersistenceManagerImpl.prepare(TransactionalPersistenceMan
agerImpl.java:1315)
        at org.objectweb.fractal.julia.generated.Cc4304444_0.prepare(INTERFACE[TransactionalPersistenceManager])
        ... 24 more
2006-09-01 10:27:34,187 : Current.getTransaction : threadTx.get= java.lang.ThreadLocal@...
2006-09-01 10:27:34,187 : Current.getTransaction : Transaction ret= null
2006-09-01 10:27:34,203 : JTAServerTransactionInterceptor.send_exception : JTAServerTransactionInterceptor.send_exceptio
n
2006-09-01 10:27:34,203 : Current.getTransaction : threadTx.get= java.lang.ThreadLocal@...
2006-09-01 10:27:34,203 : Current.getTransaction : Transaction ret= null
2006-09-01 10:27:37,937 : TransactionImpl.getStatus : TransactionImpl.getStatus()
2006-09-01 10:27:37,937 : SubCoordinator.getStatus : status=STATUS_ACTIVE
2006-09-01 10:27:37,953 : TransactionImpl.getEnlistedXAResource : getEnlistedXAResource size= 2
2006-09-01 10:27:37,953 : TransactionImpl.getTxDate : get date for tx (date=Fri Sep 01 10:27:34 CEST 2006, tx=bb14:38:0:
01381fa636f35e9afd...c3c006:)
2006-09-01 10:27:37,953 : TransactionImpl.getTxDate : get date for tx (date=Fri Sep 01 10:27:34 CEST 2006, tx=bb14:38:0:
01381fa636f35e9afd...c3c006:)
2006-09-01 10:27:37,953 : TransactionImpl.getStatus : TransactionImpl.getStatus()
2006-09-01 10:27:37,953 : SubCoordinator.getStatus : status=STATUS_ACTIVE
2006-09-01 10:27:37,969 : TransactionImpl.getEnlistedXAResource : getEnlistedXAResource size= 2
2006-09-01 10:27:37,969 : TransactionImpl.getTxDate : get date for tx (date=Fri Sep 01 10:23:42 CEST 2006, tx=bb14:38:0:
01381fa636f35e9afd...a02004:)
2006-09-01 10:27:37,969 : TransactionImpl.getTxDate : get date for tx (date=Fri Sep 01 10:23:42 CEST 2006, tx=bb14:38:0:
01381fa636f35e9afd...a02004:)
 
 


transactionActive.gif (15K) Download Attachment
LightInTheBox - Buy quality products at wholesale price!