openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: Deos DB2 support TABLE Id generation strategey
Date Wed, 10 Feb 2010 14:45:04 GMT
Hi,

The error your seeing happens when OpenJPA tries to obtain and increment the
sequence value in the table. This work needs to be done outside of the
current business transaction. In order to do that OpenJPA will try to obtain
a new connection using the non-jta-data-source (or
openjpa.ConnectionFactory2 / openjpa.Connection2URL properties if you
haven't defined a non-jta-data-source).

If OpenJPA cannot obtain a new connection we will try to suspend the current
transaction and get a new connection from the jta-data-source. The error is
reporting that we cannot suspend the transaction in your environment (the
TransactionSynchronizationRegistry doesn't support suspending transactions).

GenerationType.IDENTITY doesn't need to suspend the transaction in this
manner because it lets the database do the incrementing.

So a quick fix would be to define a non-jta-data-source in persistence.xml.
I'm not terribly familiar with Geronimo, and there might be some additional
steps to indicate that the datasource is 'non-jta', but this should work.

Hope this helps,
-mike

On Wed, Feb 10, 2010 at 4:48 AM, mlounnaci <mlounnaci@hb-technologies.dz>wrote:

>
> Hello friends,
>
> I have the following Entity:
> @Entity
> public class Workflow implements Serializable{
>
>
>        @Id
>        @TableGenerator(name="WorkflowSeq", table="IDGENERATOR",
> schema="PERSOLOGIC", pkColumnName="IDNAME",
>                        pkColumnValue="WORKFLOW", valueColumnName="IDVALUE")
>        @GeneratedValue(strategy=GenerationType.TABLE,
> generator="WorkflowSeq")
>        protected int id;
>        @Column(name = "NAME")
>        protected String name;
> }
>
> When I try to persist it i get the following exception:
>
>
> 2010-02-10 11:14:15,354 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>        at
>
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>        at
>
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:503)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:65)
>        at
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
>        at
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:760)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
>        at
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:522)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:507)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:260)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
>        at
>
> org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:138)
>        at
>
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:76)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: The Transaction Synchronization Registry
> can not suspend the current transaction.
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:419)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:290)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
>        ... 35 more
> Caused by: javax.transaction.NotSupportedException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
>
> org.apache.openjpa.ee.RegistryManagedRuntime.doNonTransactionalWork(RegistryManagedRuntime.java:203)
>        at
>
> org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:312)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:415)
>        ... 37 more
> 2010-02-10 11:15:41,747 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>        at
>
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>        at
>
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:503)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:65)
>        at
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
>        at
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:760)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
>        at
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:522)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:507)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:260)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
>        at
>
> org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:138)
>        at
>
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:76)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: The Transaction Synchronization Registry
> can not suspend the current transaction.
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:419)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:290)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
>        ... 35 more
> Caused by: javax.transaction.NotSupportedException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
>
> org.apache.openjpa.ee.RegistryManagedRuntime.doNonTransactionalWork(RegistryManagedRuntime.java:203)
>        at
>
> org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:312)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:415)
>        ... 37 more
> 2010-02-10 11:18:06,432 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>        at
>
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>        at
>
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:503)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:65)
>        at
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
>        at
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:760)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
>        at
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:522)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:507)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:260)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
>        at
>
> org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:138)
>        at
>
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:76)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: The Transaction Synchronization Registry
> can not suspend the current transaction.
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:419)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:290)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
>        ... 35 more
> Caused by: javax.transaction.NotSupportedException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
>
> org.apache.openjpa.ee.RegistryManagedRuntime.doNonTransactionalWork(RegistryManagedRuntime.java:203)
>        at
>
> org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:312)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:415)
>        ... 37 more
> 2010-02-10 11:20:29,340 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>        at
>
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>        at
>
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:503)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:65)
>        at
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
>        at
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:760)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
>        at
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:522)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:507)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:260)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
>        at
>
> org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:138)
>        at
>
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:76)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: The Transaction Synchronization Registry
> can not suspend the current transaction.
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:419)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:290)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
>        ... 35 more
> Caused by: javax.transaction.NotSupportedException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
>
> org.apache.openjpa.ee.RegistryManagedRuntime.doNonTransactionalWork(RegistryManagedRuntime.java:203)
>        at
>
> org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:312)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:415)
>        ... 37 more
> 2010-02-10 11:31:50,713 FATAL [ejb] Unknown error in container
> java.lang.NullPointerException
>        at
>
> org.apache.geronimo.openejb.GeronimoSecurityService.isCallerAuthorized(GeronimoSecurityService.java:95)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:142)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> 2010-02-10 11:34:52,352 WARN  [Transaction] Unexpected exception from
> beforeCompletion; transaction will roll back
> <openjpa-1.2.1-r2180:4612 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
>        at
>
> org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
>        at
>
> org.apache.openjpa.jdbc.sql.DB2Dictionary.newStoreException(DB2Dictionary.java:503)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
>        at
> org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:65)
>        at
> org.apache.openjpa.util.ImplHelper.generateValue(ImplHelper.java:160)
>        at
> org.apache.openjpa.util.ImplHelper.generateFieldValue(ImplHelper.java:144)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField(JDBCStoreManager.java:760)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:487)
>        at
> org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:463)
>        at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:744)
>        at
>
> org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:134)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:520)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:2824)
>        at
> org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:39)
>        at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:960)
>        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1948)
>        at
> org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
>        at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:522)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompletion(TransactionImpl.java:507)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:400)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:260)
>        at
>
> org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
>        at
>
> org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:138)
>        at
>
> org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:76)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:233)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:188)
>        at
>
> org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.doEjbObject_BUSINESS_METHOD(EjbRequestHandler.java:238)
>        at
>
> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:129)
>        at
>
> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:164)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:122)
>        at
> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:84)
>        at
> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>        at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:78)
>        at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:101)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
> Caused by: java.sql.SQLException: The Transaction Synchronization Registry
> can not suspend the current transaction.
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:419)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:290)
>        at
>
> org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
>        ... 35 more
> Caused by: javax.transaction.NotSupportedException: The Transaction
> Synchronization Registry can not suspend the current transaction.
>        at
>
> org.apache.openjpa.ee.RegistryManagedRuntime.doNonTransactionalWork(RegistryManagedRuntime.java:203)
>        at
>
> org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:312)
>        at
>
> org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:415)
>        ... 37 more
>
>
> Remark: The entity is getting persisted well using:
> @GeneratedValue(strategy=GenerationType.IDENTITY)
>
> Thanks
> --
> View this message in context:
> http://n2.nabble.com/Deos-DB2-support-TABLE-Id-generation-strategey-tp4547098p4547098.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message