Uploaded image for project: 'Continuum'
  1. Continuum
  2. CONTINUUM-1820

Error using Atomikos datasource and Postgres

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.1, 1.2
    • None
    • Database
    • None
    • Postgres 8.3
      Java 1.6.0_06
      Atomikos 3.2.3

    Description

      Getting the error "Cannot change transaction isolation level in the middle of a transaction."

      See attached patch for a configuration that will make continuum store test fail using atomikos and postgres 8.3

      javax.jdo.JDODataStoreException: Error while obtaining connection for POID generation : Cannot change transaction isolation level in the middle of a transaction.
      at org.jpox.store.rdbms.RDBMSManager$2.retrieveConnection(RDBMSManager.java:1586)
      at org.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator.obtainPoidBlock(AbstractRDBMSPoidGenerator.java:80)
      at org.jpox.store.poid.AbstractPoidGenerator.obtainPoidBlock(AbstractPoidGenerator.java:187)
      at org.jpox.store.poid.AbstractPoidGenerator.next(AbstractPoidGenerator.java:95)
      at org.jpox.store.rdbms.RDBMSManager.getStrategyValue(RDBMSManager.java:1634)
      at org.jpox.state.StateManagerImpl.populateStrategyFields(StateManagerImpl.java:812)
      at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:582)
      at org.jpox.state.StateManagerFactory.newStateManager(StateManagerFactory.java:105)
      at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1205)
      at org.jpox.AbstractPersistenceManager.makePersistentInternal(AbstractPersistenceManager.java:1259)
      at org.jpox.store.rdbms.scostore.FKListStore.validateElementForWriting(FKListStore.java:1231)
      at org.jpox.store.rdbms.scostore.FKListStore.internalAdd(FKListStore.java:772)
      at org.jpox.store.rdbms.scostore.AbstractListStore.addAll(AbstractListStore.java:387)
      at org.jpox.store.mapping.CollectionMapping.postInsert(CollectionMapping.java:209)
      at org.jpox.store.rdbms.request.InsertRequest.execute(InsertRequest.java:464)
      at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java:2519)
      at org.jpox.store.StoreManager.insert(StoreManager.java:938)
      at org.jpox.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3667)
      at org.jpox.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3646)
      at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1206)
      at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1277)
      at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:97)
      at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:78)
      at org.apache.maven.continuum.store.JdoContinuumStore.addObject(JdoContinuumStore.java:1931)
      at org.apache.maven.continuum.store.JdoContinuumStore.addObject(JdoContinuumStore.java:1926)
      at org.apache.maven.continuum.store.JdoContinuumStore.addProjectGroup(JdoContinuumStore.java:1921)
      at org.apache.maven.continuum.store.AbstractContinuumStoreTestCase.createBuildDatabase(AbstractContinuumStoreTestCase.java:397)
      at org.apache.maven.continuum.store.AbstractContinuumStoreTestCase.createBuildDatabase(AbstractContinuumStoreTestCase.java:126)
      at org.apache.maven.continuum.store.ContinuumStoreTest.setUp(ContinuumStoreTest.java:1159)
      at junit.framework.TestCase.runBare(TestCase.java:125)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      NestedThrowablesStackTrace:
      org.postgresql.util.PSQLException: Cannot change transaction isolation level in the middle of a transaction.
      at org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.java:762)
      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:597)
      at com.atomikos.jdbc.nonxa.ThreadLocalConnection.invoke(Unknown Source)
      at $Proxy0.setTransactionIsolation(Unknown Source)
      at org.jpox.store.rdbms.adapter.DatabaseAdapter.getConnection(DatabaseAdapter.java:974)
      at org.jpox.store.rdbms.RDBMSManager.getConnection(RDBMSManager.java:458)
      at org.jpox.store.rdbms.RDBMSManager$2.retrieveConnection(RDBMSManager.java:1579)
      at org.jpox.store.rdbms.poid.AbstractRDBMSPoidGenerator.obtainPoidBlock(AbstractRDBMSPoidGenerator.java:80)
      at org.jpox.store.poid.AbstractPoidGenerator.obtainPoidBlock(AbstractPoidGenerator.java:187)
      at org.jpox.store.poid.AbstractPoidGenerator.next(AbstractPoidGenerator.java:95)
      at org.jpox.store.rdbms.RDBMSManager.getStrategyValue(RDBMSManager.java:1634)
      at org.jpox.state.StateManagerImpl.populateStrategyFields(StateManagerImpl.java:812)
      at org.jpox.state.StateManagerImpl.<init>(StateManagerImpl.java:582)
      at org.jpox.state.StateManagerFactory.newStateManager(StateManagerFactory.java:105)
      at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1205)
      at org.jpox.AbstractPersistenceManager.makePersistentInternal(AbstractPersistenceManager.java:1259)
      at org.jpox.store.rdbms.scostore.FKListStore.validateElementForWriting(FKListStore.java:1231)
      at org.jpox.store.rdbms.scostore.FKListStore.internalAdd(FKListStore.java:772)
      at org.jpox.store.rdbms.scostore.AbstractListStore.addAll(AbstractListStore.java:387)
      at org.jpox.store.mapping.CollectionMapping.postInsert(CollectionMapping.java:209)
      at org.jpox.store.rdbms.request.InsertRequest.execute(InsertRequest.java:464)
      at org.jpox.store.rdbms.table.ClassTable.insert(ClassTable.java:2519)
      at org.jpox.store.StoreManager.insert(StoreManager.java:938)
      at org.jpox.state.StateManagerImpl.internalMakePersistent(StateManagerImpl.java:3667)
      at org.jpox.state.StateManagerImpl.makePersistent(StateManagerImpl.java:3646)
      at org.jpox.AbstractPersistenceManager.internalMakePersistent(AbstractPersistenceManager.java:1206)
      at org.jpox.AbstractPersistenceManager.makePersistent(AbstractPersistenceManager.java:1277)
      at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:97)
      at org.codehaus.plexus.jdo.PlexusJdoUtils.addObject(PlexusJdoUtils.java:78)
      at org.apache.maven.continuum.store.JdoContinuumStore.addObject(JdoContinuumStore.java:1931)
      at org.apache.maven.continuum.store.JdoContinuumStore.addObject(JdoContinuumStore.java:1926)
      at org.apache.maven.continuum.store.JdoContinuumStore.addProjectGroup(JdoContinuumStore.java:1921)
      at org.apache.maven.continuum.store.AbstractContinuumStoreTestCase.createBuildDatabase(AbstractContinuumStoreTestCase.java:397)
      at org.apache.maven.continuum.store.AbstractContinuumStoreTestCase.createBuildDatabase(AbstractContinuumStoreTestCase.java:126)
      at org.apache.maven.continuum.store.ContinuumStoreTest.setUp(ContinuumStoreTest.java:1159)
      at junit.framework.TestCase.runBare(TestCase.java:125)
      at junit.framework.TestResult$1.protect(TestResult.java:106)
      at junit.framework.TestResult.runProtected(TestResult.java:124)
      at junit.framework.TestResult.run(TestResult.java:109)
      at junit.framework.TestCase.run(TestCase.java:118)
      at junit.framework.TestSuite.runTest(TestSuite.java:208)
      at junit.framework.TestSuite.run(TestSuite.java:203)
      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

      Attachments

        1. atomikos-error.patch
          5 kB
          Carlos Sanchez Gonzalez

        Activity

          People

            Unassigned Unassigned
            carlos Carlos Sanchez Gonzalez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: