Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 89495 invoked from network); 7 Dec 2007 22:58:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2007 22:58:03 -0000 Received: (qmail 37978 invoked by uid 500); 7 Dec 2007 22:57:52 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 37967 invoked by uid 99); 7 Dec 2007 22:57:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2007 14:57:52 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Dec 2007 22:57:40 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0DB3A714243 for ; Fri, 7 Dec 2007 14:57:43 -0800 (PST) Message-ID: <29890229.1197068263036.JavaMail.jira@brutus> Date: Fri, 7 Dec 2007 14:57:43 -0800 (PST) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Resolved: (JDO-392) Deletion of objects when foreign-key is present : unexpected DB exceptions not handled In-Reply-To: <1205518.1152604529830.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Craig Russell resolved JDO-392. ------------------------------- Resolution: Fixed Assignee: Craig Russell The specification has been updated for handling deletion of related instances. > Deletion of objects when foreign-key is present : unexpected DB exceptions not handled > -------------------------------------------------------------------------------------- > > Key: JDO-392 > URL: https://issues.apache.org/jira/browse/JDO-392 > Project: JDO > Issue Type: Bug > Components: tck2 > Affects Versions: JDO 2 final > Reporter: Andy Jefferson > Assignee: Craig Russell > Fix For: JDO 2 maintenance release 1 > > > When I change JPOX to check for foreign-key constraints and when deleting an object with a FK present to just leave it to the DB to decide what to do (based on the specified FK) the DB throws exceptions. Such as > [java] 1) test(org.apache.jdo.tck.extents.CloseAll)javax.jdo.JDODataStoreException: Delete request failed: DELETE FROM datastoreidentity0.PERSONS WHERE DATASTORE_IDENTITY=? > [java] at org.jpox.store.rdbms.request.DeleteRequest.execute(DeleteRequest.java:274) > [java] at org.jpox.store.rdbms.table.ClassTable.delete(ClassTable.java:2495) > [java] at org.jpox.store.StoreManager.delete(StoreManager.java:902) > [java] at org.jpox.state.StateManagerImpl.internalDeletePersistent(StateManagerImpl.java:4206) > [java] at org.jpox.state.StateManagerImpl.deletePersistent(StateManagerImpl.java:4161) > [java] at org.jpox.AbstractPersistenceManager.internalDeletePersistent(AbstractPersistenceManager.java:1393) > [java] at org.jpox.AbstractPersistenceManager.deletePersistent(AbstractPersistenceManager.java:1404) > [java] at org.apache.jdo.tck.extents.ExtentTest.deleteEmployee(ExtentTest.java:200) > [java] at org.apache.jdo.tck.extents.CloseAll.test(CloseAll.java:61) > [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:237) > [java] at org.apache.jdo.tck.util.BatchTestRunner.doRun(BatchTestRunner.java:107) > [java] at org.apache.jdo.tck.util.BatchTestRunner.start(BatchTestRunner.java:147) > [java] at org.apache.jdo.tck.util.BatchTestRunner.main(BatchTestRunner.java:122) > [java] NestedThrowablesStackTrace: > [java] ERROR 23503: DELETE on table 'PERSONS' caused a violation of foreign key constraint 'PERS_MANAGER_FK' for key (885). The statement has been rolled back. > [java] at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) > [java] at org.apache.derby.impl.sql.execute.ReferencedKeyRIChecker.doCheck(Unknown Source) > [java] at org.apache.derby.impl.sql.execute.RISetChecker.doPKCheck(Unknown Source) > [java] at org.apache.derby.impl.sql.execute.DeleteResultSet.runFkChecker(Unknown Source) > [java] at org.apache.derby.impl.sql.execute.DeleteResultSet.open(Unknown Source) > [java] at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) > [java] at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) > [java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) > [java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source) > [java] at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:911) > [java] at org.jpox.store.rdbms.ParamLoggingPreparedStatement.execute(ParamLoggingPreparedStatement.java:213) > [java] at org.jpox.store.rdbms.request.Request.executeUpdate(Request.java:88) > [java] at org.jpox.store.rdbms.request.DeleteRequest.execute(DeleteRequest.java:260) > [java] at org.jpox.store.rdbms.table.ClassTable.delete(ClassTable.java:2495) > [java] at org.jpox.store.StoreManager.delete(StoreManager.java:902) > [java] at org.jpox.state.StateManagerImpl.internalDeletePersistent(StateManagerImpl.java:4206) > [java] at org.jpox.state.StateManagerImpl.deletePersistent(StateManagerImpl.java:4161) > [java] at org.jpox.AbstractPersistenceManager.internalDeletePersistent(AbstractPersistenceManager.java:1393) > [java] at org.jpox.AbstractPersistenceManager.deletePersistent(AbstractPersistenceManager.java:1404) > [java] at org.apache.jdo.tck.extents.ExtentTest.deleteEmployee(ExtentTest.java:200) > [java] at org.apache.jdo.tck.extents.CloseAll.test(CloseAll.java:61) > [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > [java] at org.apache.jdo.tck.JDO_Test.runBare(JDO_Test.java:237) > The deletion of objects should be handled by the TCK or better defined. > Alternatively the JDO2 spec should define what a JDO impl ought to do when deletePersistent is called and the object has references to other objects via FKs. JPOX has been nulling these out until now ... so the TCK ran ok. Now that we want to rely on the DB FKs we find this issue so would like to know what is "expected behaviour" -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.