The AUTO_PK_SUPPORT table is used (and created) by Cayenne to generate primary keys. When you create your DB schema in Cayenne Modeler it can automatically create that table for you (this is the "Create Primary Key Support" checkbox option). The easiest thing to do, probably, is use Cayenne Modeler to generate that table for you (only select the "Create Primary Key Support" option so you don't overwrite other tables/etc).
mrg On Wed, Feb 3, 2010 at 10:00 AM, jmp5167 <jmp5...@gmail.com> wrote: > > > Andrey Razumovsky wrote: >> >> commit exception always has its cause, so you need to investigate (and >> post >> here if needed) bottom stack trace of the exception >> >> 2010/2/3 jmp5167 <jmp5...@gmail.com> >> >>> >>> Thanks for you reply. I think I have fixed my initial problem, there was >>> a >>> problem with the cayenne.xml file. But now I am having trouble with my >>> context.commitChanges() line. I am getting this error: >>> >>> Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: >>> [v.3.0RC1 Jan 05 2010 14:44:59] Commit Exception >>> at >>> org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1134) >>> at >>> org.apache.cayenne.access.DataContext.commitChanges(DataContext.java:1045) >>> at org.example.cayenne.persistent.Main.main(Main.java:30) >>> >>> which doesnt make much sense to me except that I understand that >>> commitChanges actually sends the data to the database to be saved. >>> Otherwise I'm lost. >>> -- >>> View this message in context: >>> http://n3.nabble.com/Class-is-not-mapped-tp183513p184666.html >>> Sent from the Cayenne - User mailing list archive at Nabble.com. >>> >> >> >> >> -- >> Andrey >> >> > > > By bottom stack trace do you mean this: > > aused by: java.sql.SQLSyntaxErrorException: Table/View 'AUTO_PK_SUPPORT' > does not exist. > at > org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown > Source) > at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown > Source) > at > org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown > Source) > at > org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown > Source) > at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown > Source) > at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown > Source) > at > org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:296) > at > org.apache.cayenne.conn.ConnectionWrapper.prepareStatement(ConnectionWrapper.java:302) > at > org.apache.cayenne.access.TransactionConnectionDecorator.prepareStatement(TransactionConnectionDecorator.java:167) > at > org.apache.cayenne.dba.derby.DerbyPkGenerator.longPkFromDatabase(DerbyPkGenerator.java:69) > at > org.apache.cayenne.dba.JdbcPkGenerator.generatePk(JdbcPkGenerator.java:270) > at > org.apache.cayenne.access.DataDomainInsertBucket.createPermIds(DataDomainInsertBucket.java:165) > at > org.apache.cayenne.access.DataDomainInsertBucket.appendQueriesInternal(DataDomainInsertBucket.java:76) > at > org.apache.cayenne.access.DataDomainSyncBucket.appendQueries(DataDomainSyncBucket.java:79) > at > org.apache.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:182) > at > org.apache.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:134) > at > org.apache.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:824) > at > org.apache.cayenne.access.DataDomain$2.transform(DataDomain.java:791) > at > org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:850) > at org.apache.cayenne.access.DataDomain.onSync(DataDomain.java:788) > at > org.apache.cayenne.access.DataContext.flushToParent(DataContext.java:1106) > ... 2 more > Caused by: java.sql.SQLException: Table/View 'AUTO_PK_SUPPORT' does not > exist. > at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown > Source) > at > org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown > Source) > ... 30 more > Caused by: ERROR 42X05: Table/View 'AUTO_PK_SUPPORT' does not exist. > at org.apache.derby.iapi.error.StandardException.newException(Unknown > Source) > at > org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor(Unknown > Source) > at > org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables(Unknown > Source) > at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown > Source) > at > org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables(Unknown > Source) > at > org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables(Unknown > Source) > at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown > Source) > at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown > Source) > at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown > Source) > at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) > at > org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown > Source) > ... 24 more > > > because I was looking at this but the only thing I recognize is that it says > AUTO_PK_SUPPORT does not exist. I have primary keys set but I dont know > what the rest of it means > -- > View this message in context: > http://n3.nabble.com/Class-is-not-mapped-tp183513p184713.html > Sent from the Cayenne - User mailing list archive at Nabble.com. >