You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (JIRA)" <ji...@apache.org> on 2012/07/20 22:33:34 UTC
[jira] [Assigned] (OPENJPA-2232) TestAudit failed against databases
other than Derby
[ https://issues.apache.org/jira/browse/OPENJPA-2232?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Albert Lee reassigned OPENJPA-2232:
-----------------------------------
Assignee: Pinaki Poddar
> TestAudit failed against databases other than Derby
> ---------------------------------------------------
>
> Key: OPENJPA-2232
> URL: https://issues.apache.org/jira/browse/OPENJPA-2232
> Project: OpenJPA
> Issue Type: Test
> Components: jdbc
> Affects Versions: 2.3.0
> Reporter: Albert Lee
> Assignee: Pinaki Poddar
>
> After TestAudit is changed/introduced recently, this test failed on some database platforms yielding the following exception:
> TestAudit.testAuditorIsConfigured (org.apache.openjpa.audit)
> « hide details
> <openjpa-2.3.0-SNAPSHOT-runknown fatal store error> org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
> FailedObject: org.apache.openjpa.audit.X@df0dfb
> at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:594)
> at org.apache.openjpa.audit.TestAudit.createManagedObject(TestAudit.java:64)
> at org.apache.openjpa.audit.TestAudit.setUp(TestAudit.java:52)
> 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 sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
> at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
> at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
> 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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
> at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
> Caused by: <openjpa-2.3.0-SNAPSHOT-runknown fatal store error> org.apache.openjpa.persistence.EntityExistsException: The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
> FailedObject: org.apache.openjpa.audit.X@df0dfb
> at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2339)
> at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2176)
> 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)
> ... 22 more
> Caused by: <openjpa-2.3.0-SNAPSHOT-runknown fatal store error> org.apache.openjpa.persistence.EntityExistsException: Violation of PRIMARY KEY constraint 'PK__X__22E905E4'. Cannot insert duplicate key in object 'dbo.X'. {prepstmnt 22424958 INSERT INTO X (id, name, price) VALUES (?, ?, ?)} [code=2627, state=23000]
> FailedObject: org.apache.openjpa.audit.X@df0dfb
> at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4926)
> at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4901)
> at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
> at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143)
> at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87)
> at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
> at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
> at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
> at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:105)
> at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:78)
> at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:735)
> at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
> ... 29 more
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Violation of PRIMARY KEY constraint 'PK__X__22E905E4'. Cannot insert duplicate key in object 'dbo.X'. {prepstmnt 22424958 INSERT INTO X (id, name, price) VALUES (?, ?, ?)} [code=2627, state=23000]
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:219)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:195)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:59)
> at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1134)
> at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:272)
> at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1765)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267)
> at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118)
> ... 39 more
> ------- Stderr: -------
> 5 audit INFO [main] openjpa.Runtime - Starting OpenJPA 2.3.0-SNAPSHOT
> 6 audit INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.SQLServerDictionary".
> The test passed on Derby but failed in HSQL, MS SQLServer, MySQL, Oracle, DB2, Postgre, SolidDB and may be other databases.
> The set of tests failed are:
> TestAudit.testAuditorIsConfigured (org.apache.openjpa.audit)
> TestAudit.testNewInstancesAreAudited (org.apache.openjpa.audit)
> TestAudit.testUpdateOutsideTransactionAreAudited (org.apache.openjpa.audit)
> TestAudit.testUpdateInsideTransactionAreAudited (org.apache.openjpa.audit)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira