cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emerson Castaneda (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CAY-1948) Oracle adapter: Quoting sequence names when appropriate
Date Mon, 15 Jan 2018 23:13:00 GMT

    [ https://issues.apache.org/jira/browse/CAY-1948?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16326611#comment-16326611
] 

Emerson Castaneda edited comment on CAY-1948 at 1/15/18 11:12 PM:
------------------------------------------------------------------

Same here for *v.4.1.M1*, but the real cause I found is not because of lowercase-definition/uppercase-call
reason you suspected about, it is because in the modeler you should use the notation like:

 
{noformat}
<schema>.<sequence-name>{noformat}
so the map get defined as:

 

 

{{<db-key-generator>}}
 <db-generator-type>ORACLE</db-generator-type>
 <db-generator-name><schema>.<sequence-name></db-generator-name>
 {{</db-key-generator>}}

 

Full trace:
{noformat}
org.apache.cayenne.CayenneRuntimeException: [v.4.1.M1 Oct 06 2017 09:23:31] Commit Exception
 at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:774)
 at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:691)
 at net.emecas.boot.is.lda.service.LdFieldDefinitionCRUDIntegrationTest.a_CreateTest(LdFieldDefinitionCRUDIntegrationTest.java:97)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
 at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
 at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
 at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
 at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
 at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
 at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)
 at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
 at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
 at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
 at org.apache.cayenne.dba.oracle.OraclePkGenerator.longPkFromDatabase(OraclePkGenerator.java:171)
 at org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:230)
 at org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:162)
 at org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:73)
 at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:78)
 at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:185)
 at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:143)
 at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:633)
 at org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:603)
 at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:764)
 at org.apache.cayenne.tx.TransactionFilter$1.perform(TransactionFilter.java:73)
 at org.apache.cayenne.tx.TransactionFilter$1.perform(TransactionFilter.java:70)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:87)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInLocalTransaction(DefaultTransactionManager.java:59)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:52)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40)
 at org.apache.cayenne.tx.TransactionFilter.onSync(TransactionFilter.java:70)
 at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:764)
 at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:590)
 at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:742)
 ... 33 more
{noformat}
 

 


was (Author: emecas):
Same here for *v.4.1.M1*, but the real cause I found is not because of lowercase-definition/uppercase-call
reason you suspected about, it is because in the modeler you should use the notation like:

 
{noformat}
<schema>.<sequence-name>{noformat}
so the map get defined as:

 

 

{{<db-key-generator>}}
{{   <db-generator-type>ORACLE</db-generator-type>}}
{{   <db-generator-name><schema>.<sequence-name></db-generator-name>}}
{{</db-key-generator>}}

 

Full trace:
{noformat}
org.apache.cayenne.CayenneRuntimeException: [v.4.1.M1 Oct 06 2017 09:23:31] Commit Exception
 at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:774)
 at org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:691)
 at net.emecas.boot.is.lda.service.LdFieldDefinitionCRUDIntegrationTest.a_CreateTest(LdFieldDefinitionCRUDIntegrationTest.java:97)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
 at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
 at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
 at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
 at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
 at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
 at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
 at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)
 at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
 at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
 at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
 at org.apache.cayenne.dba.oracle.OraclePkGenerator.longPkFromDatabase(OraclePkGenerator.java:171)
 at org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:230)
 at org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:162)
 at org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:73)
 at org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:78)
 at org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:185)
 at org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:143)
 at org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:633)
 at org.apache.cayenne.access.DataDomain.onSyncNoFilters(DataDomain.java:603)
 at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:764)
 at org.apache.cayenne.tx.TransactionFilter$1.perform(TransactionFilter.java:73)
 at org.apache.cayenne.tx.TransactionFilter$1.perform(TransactionFilter.java:70)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:87)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInLocalTransaction(DefaultTransactionManager.java:59)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:52)
 at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:40)
 at org.apache.cayenne.tx.TransactionFilter.onSync(TransactionFilter.java:70)
 at org.apache.cayenne.access.DataDomain$DataDomainSyncFilterChain.onSync(DataDomain.java:764)
 at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:590)
 at org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:742)
 ... 33 more
{noformat}
 

 

> Oracle adapter: Quoting sequence names when appropriate
> -------------------------------------------------------
>
>                 Key: CAY-1948
>                 URL: https://issues.apache.org/jira/browse/CAY-1948
>             Project: Cayenne
>          Issue Type: Improvement
>    Affects Versions: 3.1RC1, 3.2.M1
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Minor
>
> I noticed that when running unit tests against Oracle after a first run, all following
runs fail with the error below ("ORA-02289: sequence does not exist"). Essentially we can't
 "drop pk_test_qualified1". I haven't looked closely yet, but I suspect this is caused by
the fact that the sequence was created in lowercase , but when dropping it without quoting
the name, Oracle tries to find an uppercase sequence. So we might need to apply appropriate
quotation strategy.
> INFO: DROP SEQUENCE pk_test_qualified1
> org.apache.maven.surefire.booter.SurefireExecutionException: org.apache.cayenne.access.trans.BatchQueryBuilderTest;
nested exception is java.lang.ExceptionInInitializerError: null; nested exception is org.apache.maven.surefire.testset.TestSetFailedException:
org.apache.cayenne.access.trans.BatchQueryBuilderTest; nested exception is java.lang.ExceptionInInitializerError:
null
> org.apache.maven.surefire.testset.TestSetFailedException: org.apache.cayenne.access.trans.BatchQueryBuilderTest;
nested exception is java.lang.ExceptionInInitializerError: null
> java.lang.ExceptionInInitializerError
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at junit.framework.TestSuite.createTest(TestSuite.java:131)
> 	at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
> 	at junit.framework.TestSuite.<init>(TestSuite.java:75)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at org.apache.maven.surefire.junit.JUnitTestSet.constructTestObject(JUnitTestSet.java:151)
> 	at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:197)
> 	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: java.lang.RuntimeException: Error rebuilding schema
> 	at org.apache.cayenne.unit.di.server.SchemaBuilder.rebuildSchema(SchemaBuilder.java:138)
> 	at org.apache.cayenne.unit.di.server.ServerCase.<clinit>(ServerCase.java:46)
> 	... 22 more
> Caused by: java.sql.SQLSyntaxErrorException: ORA-02289: sequence does not exist
> 	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:459)
> 	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:400)
> 	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:999)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message