Community
Participate
Working Groups
Issue reported on behalf of Sabine Heider: I'd like to get your opinion on an error I get when running the JPA server tests inside an SAP NetWeaver application server (stack shortened, executed on current trunk): java.lang.IllegalStateException: Attempting to execute an operation on a closed EntityManager. at org.eclipse.persistence.internal.jpa.EntityManagerImpl.verifyOpen(EntityManagerImpl.java:1516) at org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeUpdate(EJBQueryImpl.java:492) at org.eclipse.persistence.testing.tests.jpa.relationships.EMQueryJUnitTestSuite.testcreateNativeQueryWithSelectSQL(EMQueryJUnitTestSuite.java:121) at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:463) at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87) I run the test against a MySQL database. The MySQL driver throws an SQLException in EMQueryJUnitTestSuite line 114: Can not issue executeUpdate() for SELECTs. Consequently, I end up in the catch block where the current transaction is rolled back. Chapter 7.9.1 of the JPA specification says: "After the JTA transaction has completed (either by transaction commit or rollback), The container closes the entity manager by calling EntityManager.close." Apparently, this is what the JPA container in NetWeaver does. With the closed entity manager, however, query2 becomes unusable. In my opinion, it's an error of the test rather than of the JPA container
I think the issue is the rollback. If we'd do without the rollback, it should work. It actually works on NetWeaver.
Created attachment 153251 [details] patch (remove the rollback from the test)
Changing the priority of the bugs that have been recently triaged to future. Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
*** This bug has been marked as a duplicate of bug 296346 ***
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink