openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gustavo Lopes (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2312) H2 is forced to autoCommit; breaks transactions
Date Wed, 19 Dec 2012 13:49:12 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13535959#comment-13535959
] 

Gustavo Lopes commented on OPENJPA-2312:
----------------------------------------

Yes, I can confirm setting openjpa.jdbc.DBDictionary resolves the problem; thanks.

I'm not sure I want to use the managed connection factory mode. If I set openjpa.ConnectionFactoryMode
to true, openjpa seems to assume there is a JTA transaction manager available, which is not
the case (exception below). I think what I want is to have String's JpaTransactionManager
manage the transactions (so in a completely external fashion). Is that scenario even supported?
I see for instance that OpenJPA tries to do things like suspending the transaction when generating
a new sequence value.

org.springframework.orm.jpa.JpaSystemException: Unable to obtain a TransactionManager using
null. ; nested exception is <openjpa-2.2.1-r422266:1396819 fatal general error> org.apache.openjpa.persistence.PersistenceException:
Unable to obtain a TransactionManager using null. 
	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:326)
	at org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:516)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
	at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
	at org.springframework.test.context.transaction.TransactionalTestExecutionListener$TransactionContext.endTransaction(TransactionalTestExecutionListener.java:522)
	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.endTransaction(TransactionalTestExecutionListener.java:293)
	at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:186)
	at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:406)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:91)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
Caused by: <openjpa-2.2.1-r422266:1396819 fatal general error> org.apache.openjpa.persistence.PersistenceException:
Unable to obtain a TransactionManager using null. 
	at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4958)
	at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4918)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:110)
	at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:62)
	at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:66)
	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:778)
	at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:493)
	at org.apache.openjpa.util.ApplicationIds.assign(ApplicationIds.java:469)
	at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId(JDBCStoreManager.java:762)
	at org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId(DelegatingStoreManager.java:135)
	at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:600)
	at org.apache.openjpa.kernel.StateManagerImpl.preFlush(StateManagerImpl.java:3023)
	at org.apache.openjpa.kernel.PNewState.beforeFlush(PNewState.java:44)
	at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush(StateManagerImpl.java:1042)
	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2114)
	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2074)
	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1992)
	at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1516)
	at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:933)
	at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:570)
	at org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionManager.java:512)
	... 23 more
Caused by: java.sql.SQLException: Unable to obtain a TransactionManager using null. 
	at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:449)
	at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal(TableJDBCSeq.java:300)
	at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next(AbstractJDBCSeq.java:60)
	... 42 more
Caused by: javax.transaction.NotSupportedException: Unable to obtain a TransactionManager
using null. 
	at org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:309)
	at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence(TableJDBCSeq.java:445)
	... 44 more
Caused by: <openjpa-2.2.1-r422266:1396819 fatal user error> org.apache.openjpa.util.InvalidStateException:
Could not perform automatic lookup of EJB container's javax.transaction.TransactionManager
implementation. Please ensure that you are running the application from within an EJB 1.1
compliant EJB container, and then set the org.apache.openjpa.ManagedRuntime property to the
appropriate value to obtain the TransactionManager.
	at org.apache.openjpa.ee.AutomaticManagedRuntime.getTransactionManager(AutomaticManagedRuntime.java:253)
	at org.apache.openjpa.ee.AutomaticManagedRuntime.doNonTransactionalWork(AutomaticManagedRuntime.java:307)
	... 45 more
Caused by: javax.naming.NameNotFoundException; remaining name 'TransactionSynchronizationRegistry'
	...
                
> H2 is forced to autoCommit; breaks transactions
> -----------------------------------------------
>
>                 Key: OPENJPA-2312
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2312
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Gustavo Lopes
>         Attachments: details.txt
>
>
> DataSourceFactory::installDBDictionary() sets autocommit to TRUE on the ConfiguringConnectionDecorator
because supportsMultipleNontransactionalResultSets is true.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message