So I'm trying to do a simple update against an Oracle XE database. Inserts and deletes work beautifully. My code is as simple as:
Session session = (Session) session(); EOEditingContext ec = session.defaultEditingContext();
NSLog.allowDebugLoggingForGroups(0x10000L);
anIdea.setAcceptedStatus(); ec.saveChanges();
NSLog.refuseDebugLoggingForGroups(0x10000L);
all setAcceptedStatus does is setStatus("A")
I get the following error:
Error: com.webobjects.eoaccess.EOGeneralAdaptorException: updateValuesInRowDescribedByQualifier -- com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in database Reason: updateValuesInRowDescribedByQualifier -- com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in database Stack trace: File Line# Method Package EODatabaseContext.java 4685 _exceptionWithDatabaseContextInformationAdded com.webobjects.eoaccess EODatabaseContext.java 6393 performChanges com.webobjects.eoaccess EOObjectStoreCoordinator.java 415 saveChangesInEditingContext com.webobjects.eocontrol EOEditingContext.java 3226 saveChanges com.webobjects.eocontrol......
So I turned on SQL debugging (as seen above). Get the following:
[2006-10-10 18:18:39 MDT] <WorkerThread0> === Begin Internal Transaction [2006-10-10 18:18:39 MDT] <WorkerThread0> evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "UPDATE IDEA SET STATUS = ? WHERE (IDEA_OID = ? AND AVGRATING is NULL AND CATEGORY_OID = ? AND IDEADESC = ? AND IDEANAME = ? AND IDEAURL is NULL AND NUMRATINGS is NULL AND PARENT_OID is NULL AND STATUS = ? AND SUBMIT_DATE = ? AND USER_OID = ?)" withBindings: 1:"A"(status), 2:1(ideaOid), 3:6(categoryOid), 4:"afdsafadsfasfa"(ideaDesc), 5:"fdsfadf"(ideaName), 6:"P"(status), 7:2006-10-08 00:00:00(submitDate), 8:1(userOid)> [2006-10-10 18:18:39 MDT] <WorkerThread0> === Rollback Internal Transaction
Trying this in sqlplus with this statement: UPDATE IDEA SET STATUS = "A" WHERE (IDEA_OID = 1 AND AVGRATING is NULL AND CATEGORY_OID = 6 AND IDEADESC = "afdsafadsfasfa" AND IDEANAME = "fdsfadf" AND IDEAURL is NULL AND NUMRATINGS is NULL AND PARENT_OID is NULL AND STATUS = "P" AND SUBMIT_DATE = "2006-10-08 00:00:00" AND USER_OID = 1)";
returns: ERROR: ORA-00972: identifier is too long
Any ideas? I guess I could try a different adaptor (was thinking of switching to MySQL anyway, but I am fairly familiar with Oracle, XE is free).
Thanks in advance! Tarun |