Hi Rick, I tried setting the oracle dictionary property as you suggested, but it still resulted in the same error. Thanks for your suggestion anyway.
I also tried setting up <non-jta-data-source> to refer to a non-XA Oracle datasource, and that has resolved the issue. Presumably this is because the non-jta-data-source is used by OpenJPA to perform its initialization in autoCommit mode, and the jta-data-source is used by my application to run its transactions. Rupert On 26 June 2014 14:53, Rick Curtis <curti...@gmail.com> wrote: > Try to set the following property in your persistence.xml : <property > name="openjpa.jdbc.sql.DBDictionary" value="oracle"/> > > Thanks, > Rick > > > On Thu, Jun 26, 2014 at 7:54 AM, Rupert Smith < > rupertlssm...@googlemail.com> > wrote: > > > I am getting this error during installDBDictionary: > > > > Caused by: java.sql.SQLException: could not use local transaction commit > in > > a global transaction > > at > > > > > oracle.jdbc.driver.PhysicalConnection.disallowGlobalTxnMode(PhysicalConnection.java:6825) > > at > > > oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3812) > > at > > > oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:3857) > > at > > > > > oracle.jdbc.OracleConnectionWrapper.commit(OracleConnectionWrapper.java:140) > > at > > > > > org.tranql.connector.jdbc.ManagedXAConnection.localTransactionCommit(ManagedXAConnection.java:102) > > at > > > > > org.tranql.connector.AbstractManagedConnection$LocalTransactionImpl.commit(AbstractManagedConnection.java:199) > > at > > > > > org.tranql.connector.jdbc.ConnectionHandle.setAutoCommit(ConnectionHandle.java:160) > > at > > > > > org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:167) > > at > > > > > org.apache.openjpa.lib.jdbc.DelegatingConnection.setAutoCommit(DelegatingConnection.java:167) > > 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:99) > > at > > > > > org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:94) > > at > > > > > org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:236) > > ... 82 more > > > > I am using an XADataSource, and this data source is set up in my > > persistence.xml: > > > > <jta-data-source>osgi:service/javax.sql.DataSource/( > > osgi.jndi.service.name=jdbc/AppDataSource)</jta-data-source> > > <non-jta-data-source>osgi:service/javax.sql.DataSource/( > > osgi.jndi.service.name=jdbc/AppDataSource)</non-jta-data-source> > > > > I am thinking the above error might be caused because the > > installDBDictionary process tries to take the data source and put it in > > autocommit mode? > > > > Should I be setting up a non-XA datasource and configuring that as the > > <non-jta-data-source> in the persistence.xml? > > > > Thanks for your help. > > > > Rupert > > > > > > -- > *Rick Curtis* >