[Seasar-user:20505] Re: Hibernate -> OpenJPA 切り替えについて

oh [E-MAIL ADDRESS DELETED]
2011年 1月 11日 (火) 21:34:11 JST


長谷川です。

On Tue, 11 Jan 2011 21:03:28 +0900
Koichi Kobayashi <[E-MAIL ADDRESS DELETED]> wrote:
> > 
> > どうも、setAutoCommit が true に設定されているかららしく、
> 
> 日本語がわかりにくいのですが、setAutoCommit() が
> 引数 true で呼び出されている、ということで
> いいでしょうか?
> 
> だとすると、誰が呼び出しているかで対応が変わります。
> とりあえずスタックトレースを見せてください。
> 

すみませんでした、わかりにくい表現で。
スタックトレースは以下になってます。eclipse からテストケース実行で
例外となっています。

<openjpa-1.1.0-r422266:659716 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: <openjpa-1.1.0-r422266:659716 fatal store error> org.apache.openjpa.util.StoreException: [ESSR0366]分散トランザクションでは使用できない操作です
	at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:235)
	at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory2(JDBCConfigurationImpl.java:744)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:288)
	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1409)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:646)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createEntityManager(TxScopedEntityManagerProxy.java:127)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.getEntityManager(TxScopedEntityManagerProxy.java:106)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createNativeQuery(TxScopedEntityManagerProxy.java:182)
	at poj.pics.cm.web.service.impl.FooServiceImpl.doit(FooServiceImpl.java:43)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.$$doit$$invokeSuperMethod$$(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.extension.tx.DefaultTransactionCallback.execute(DefaultTransactionCallback.java:58)
	at org.seasar.extension.tx.adapter.JTATransactionManagerAdapter.required(JTATransactionManagerAdapter.java:65)
	at org.seasar.framework.ejb.tx.EJB3RequiredInterceptor.invoke(EJB3RequiredInterceptor.java:63)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.doit(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.FooServiceTest.doit(FooServiceTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)
	at org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)
	at org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)
	at org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)
	at org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)
	at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.seasar.framework.exception.SSQLException: [ESSR0366]分散トランザクションでは使用できない操作です
	at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.assertLocalTx(ConnectionWrapperImpl.java:157)
	at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.setAutoCommit(ConnectionWrapperImpl.java:352)
	at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
	at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.setAutoCommit(ConfiguringConnectionDecorator.java:117)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.<init>(ConfiguringConnectionDecorator.java:111)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.decorate(ConfiguringConnectionDecorator.java:93)
	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.decorate(DecoratingDataSource.java:100)
	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:94)
	at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:230)
	... 44 more

	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:196)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createEntityManager(TxScopedEntityManagerProxy.java:127)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.getEntityManager(TxScopedEntityManagerProxy.java:106)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createNativeQuery(TxScopedEntityManagerProxy.java:182)
	at poj.pics.cm.web.service.impl.FooServiceImpl.doit(FooServiceImpl.java:43)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.$$doit$$invokeSuperMethod$$(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.extension.tx.DefaultTransactionCallback.execute(DefaultTransactionCallback.java:58)
	at org.seasar.extension.tx.adapter.JTATransactionManagerAdapter.required(JTATransactionManagerAdapter.java:65)
	at org.seasar.framework.ejb.tx.EJB3RequiredInterceptor.invoke(EJB3RequiredInterceptor.java:63)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.doit(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.FooServiceTest.doit(FooServiceTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)
	at org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)
	at org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)
	at org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)
	at org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)
	at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.RuntimeException: There were errors initializing your configuration: <openjpa-1.1.0-r422266:659716 fatal store error> org.apache.openjpa.util.StoreException: [ESSR0366]分散トランザクションでは使用できない操作です
	at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:235)
	at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory2(JDBCConfigurationImpl.java:744)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:288)
	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1409)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:646)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createEntityManager(TxScopedEntityManagerProxy.java:127)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.getEntityManager(TxScopedEntityManagerProxy.java:106)
	at org.seasar.framework.jpa.impl.TxScopedEntityManagerProxy.createNativeQuery(TxScopedEntityManagerProxy.java:182)
	at poj.pics.cm.web.service.impl.FooServiceImpl.doit(FooServiceImpl.java:43)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.$$doit$$invokeSuperMethod$$(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at org.seasar.extension.tx.DefaultTransactionCallback.execute(DefaultTransactionCallback.java:58)
	at org.seasar.extension.tx.adapter.JTATransactionManagerAdapter.required(JTATransactionManagerAdapter.java:65)
	at org.seasar.framework.ejb.tx.EJB3RequiredInterceptor.invoke(EJB3RequiredInterceptor.java:63)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af$$MethodInvocation$$doit0.proceed(MethodInvocationClassGenerator.java)
	at poj.pics.cm.web.service.impl.FooServiceImpl$$EnhancedByS2AOP$$12fb0af.doit(FooServiceImpl$$EnhancedByS2AOP$$12fb0af.java)
	at poj.pics.cm.web.service.FooServiceTest.doit(FooServiceTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethodBody(S2TestMethodRunner.java:672)
	at org.seasar.framework.unit.S2TestMethodRunner.executeMethod(S2TestMethodRunner.java:647)
	at org.seasar.framework.unit.S2TestMethodRunner.runTest(S2TestMethodRunner.java:612)
	at org.seasar.framework.unit.S2TestMethodRunner.runMethod(S2TestMethodRunner.java:250)
	at org.seasar.framework.unit.S2TestMethodRunner.run(S2TestMethodRunner.java:166)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.invokeTestMethod(S2TestClassMethodsRunner.java:227)
	at org.seasar.framework.unit.S2TestClassMethodsRunner.run(S2TestClassMethodsRunner.java:89)
	at org.seasar.framework.unit.S2TestClassRunner.run(S2TestClassRunner.java:67)
	at org.seasar.framework.unit.Seasar2.run(Seasar2.java:179)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.seasar.framework.exception.SSQLException: [ESSR0366]分散トランザクションでは使用できない操作です
	at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.assertLocalTx(ConnectionWrapperImpl.java:157)
	at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.setAutoCommit(ConnectionWrapperImpl.java:352)
	at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
	at org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:198)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.setAutoCommit(ConfiguringConnectionDecorator.java:117)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.<init>(ConfiguringConnectionDecorator.java:111)
	at org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator.decorate(ConfiguringConnectionDecorator.java:93)
	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.decorate(DecoratingDataSource.java:100)
	at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:94)
	at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:230)
	... 44 more

	at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll(ConfigurationImpl.java:302)
	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll(OpenJPAConfigurationImpl.java:1409)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:646)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:183)
	... 35 more

以上、よろしくお願いいたします。
-- 
_/_/
_/_/ mailto: [E-MAIL ADDRESS DELETED]
_/_/



Seasar-user メーリングリストの案内