Sybase PK generation problem
-----------------------------
Key: CAY-588
URL: http://issues.apache.org/cayenne/browse/CAY-588
Project: Cayenne
Type: Bug
Components: Cayenne Core Library
Versions: 1.2
Environment: Sybase ASE 12.5.3 , Mac OS X Panther
Reporter: Andrus Adamchik
Assigned to: Andrus Adamchik
Fix For: 1.2
This thread has been going on for a while:
http://objectstyle.org/cayenne/lists/cayenne-devel/2006/06/0126.html
What I didn't realize is that the default pk generator included in Sybase adapter stopped working due to the differences in transaction handling with earlier cayenne version (see stack trace below). I just installed Sybase on an old Mac laptop and will be working on fixing this.
org.objectstyle.cayenne.CayenneRuntimeException: [v..AYENNE_VERSION@ @CAYENNE_BUILD_DATE@] Commit Exception
at org.objectstyle.cayenne.access.DataContext.flushToParent(DataContext.java:1289)
at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1165)
at org.objectstyle.cayenne.CDOMany2OneNoRevTst.testNewAdd(CDOMany2OneNoRevTst.java:87)
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:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:457)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:670)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Stored procedure 'auto_pk_for_table' may be run only in unchained transaction mode. The 'SET CHAINED OFF' command will cause the current session to use unchained transaction mode.
at com.sybase.jdbc3.tds.Tds.processEed(Tds.java:2942)
at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2246)
at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(ResultGetter.java:69)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:220)
at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:203)
at com.sybase.jdbc3.jdbc.SybStatement.executeLoop(SybStatement.java:1868)
at com.sybase.jdbc3.jdbc.SybCallableStatement.execute(SybCallableStatement.java:157)
at org.objectstyle.cayenne.dba.sybase.SybasePkGenerator.pkFromDatabase(SybasePkGenerator.java:179)
at org.objectstyle.cayenne.dba.JdbcPkGenerator.generatePkForDbEntity(JdbcPkGenerator.java:326)
at org.objectstyle.cayenne.access.DataDomainInsertBucket.createPermIdsForObjEntity(DataDomainInsertBucket.java:194)
at org.objectstyle.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:122)
at org.objectstyle.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:108)
at org.objectstyle.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:211)
at org.objectstyle.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:167)
at org.objectstyle.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:830)
at org.objectstyle.cayenne.access.DataDomain$2.transform(DataDomain.java:801)
at org.objectstyle.cayenne.access.DataDomain.runInTransaction(DataDomain.java:856)
at org.objectstyle.cayenne.access.DataDomain.onSync(DataDomain.java:798)
at org.objectstyle.cayenne.access.DataContext.flushToParent(DataContext.java:1261)
... 20 more
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/cayenne/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
This archive was generated by hypermail 2.0.0 : Thu Jul 06 2006 - 18:02:40 EDT