Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 39829 invoked from network); 12 Sep 2006 17:56:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Sep 2006 17:56:46 -0000 Received: (qmail 19146 invoked by uid 500); 12 Sep 2006 17:56:46 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 19117 invoked by uid 500); 12 Sep 2006 17:56:46 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Received: (qmail 19108 invoked by uid 99); 12 Sep 2006 17:56:46 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2006 10:56:46 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=Craig.Russell@Sun.COM; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain Sun.COM from 192.18.42.249 cause and error) Received: from ([192.18.42.249:22830] helo=nwkea-pix-1.sun.com) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 8D/91-03642-4E4F6054 for ; Tue, 12 Sep 2006 10:56:54 -0700 Received: from d1-sfbay-09.sun.com ([192.18.39.119]) by nwkea-pix-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k8CHuaeK026032 for ; Tue, 12 Sep 2006 10:56:36 -0700 (PDT) Received: from conversion-daemon.d1-sfbay-09.sun.com by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J5H00601R27TG00@d1-sfbay-09.sun.com> (original mail from Craig.Russell@Sun.COM) for open-jpa-dev@incubator.apache.org; Tue, 12 Sep 2006 10:56:36 -0700 (PDT) Received: from [192.168.0.10] (c-24-6-172-77.hsd1.ca.comcast.net [24.6.172.77]) by d1-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J5H00CPZR68MM20@d1-sfbay-09.sun.com> for open-jpa-dev@incubator.apache.org; Tue, 12 Sep 2006 10:56:33 -0700 (PDT) Date: Tue, 12 Sep 2006 10:56:30 -0700 From: Craig L Russell Subject: Re: [jira] Resolved: (OPENJPA-39) Cascade delete does not work with foreign key constraints In-reply-to: <8B82BA34-FBFF-467A-980B-88DE8B563521@bea.com> Sender: Craig.Russell@Sun.COM To: open-jpa-dev@incubator.apache.org Message-id: <635DB2CA-D031-4C3C-A95C-24507AC458F3@SUN.com> MIME-version: 1.0 X-Mailer: Apple Mail (2.752.2) Content-type: multipart/signed; protocol="application/pkcs7-signature"; boundary=Apple-Mail-138--612034730; micalg=sha1 References: <14156901.1158019042738.JavaMail.jira@brutus> <3DB84D99-8C19-4168-A8D1-5FC1ED565073@SUN.com> <8B82BA34-FBFF-467A-980B-88DE8B563521@bea.com> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --Apple-Mail-138--612034730 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Hi Abe, On Sep 12, 2006, at 9:21 AM, Abe White wrote: >> >>> - When you delete a parent object and the operation cascades to >>> children, the object-level operation order is delete parent, then >>> delete children. >> >> In my experience, the cascade should delete the children first. >> This solves 99% of the cascade delete issues. > > It seems to me you'd just have the exact same problem when forward > foreign keys (rather than inverse ones as in a one-many) are used. I think that cascade delete is most commonly used where there is a one-to-possibly-zero relationship (with a [zero or one or many]-to- one on the other side). Thus, the other side has the foreign key, and the side with the cascade delete definition is the side with the existence that doesn't depend on the other side. So deleting the other side first usually solves the timing issues. > Or do you mean that cascading to a collection should delete the > children first, but cascading through a to-one should not? The side with the cascade delete is not the side with the foreign key that might be violated. So deleting the other side first should always work. >>> Register now for BEA World 2006 --- See http://www.bea.com/ >>> beaworld<< Thanks for the personal invitation. Craig > ______________________________________________________________________ > _ > Notice: This email message, together with any attachments, may > contain > information of BEA Systems, Inc., its subsidiaries and > affiliated > entities, that may be confidential, proprietary, copyrighted > and/or > legally privileged, and is intended solely for the use of the > individual > or entity named in this message. If you are not the intended > recipient, > and have received this message in error, please immediately return > this > by email and then delete it. Craig Russell clr@apache.org http://db.apache.org/jdo --Apple-Mail-138--612034730 Content-Transfer-Encoding: base64 Content-Type: application/pkcs7-signature; name=smime.p7s Content-Disposition: attachment; filename=smime.p7s MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIGUDCCAwkw ggJyoAMCAQICEB7Y7fLHmKoeHTUdbtYrvpAwDQYJKoZIhvcNAQEEBQAwYjELMAkGA1UEBhMCWkEx JTAjBgNVBAoTHFRoYXd0ZSBDb25zdWx0aW5nIChQdHkpIEx0ZC4xLDAqBgNVBAMTI1RoYXd0ZSBQ ZXJzb25hbCBGcmVlbWFpbCBJc3N1aW5nIENBMB4XDTA1MTIxNTIxNDc0NFoXDTA2MTIxNTIxNDc0 NFowbDEQMA4GA1UEBBMHUnVzc2VsbDEUMBIGA1UEKhMLQ3JhaWcgTGFpcmQxHDAaBgNVBAMTE0Ny YWlnIExhaXJkIFJ1c3NlbGwxJDAiBgkqhkiG9w0BCQEWFUNyYWlnLlJ1c3NlbGxAU3VuLkNPTTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMXXgEAm88nu8cFbxXSWqTq+GaYpCx/0QSom 8kBbVxpJIURuO4ErLDupeXu6y9+5e7ZKLbeSQE5xbfYPcQR/IhqmYKy5YqRcuzPXREBj2zKEkZph pNXWpHgMdx9W8dq0Cu2i9Ux/S6c2MuEHrP6gfGGll+b/mzLoO280QHTuE4pcpKntRnwZdGxQ/5l8 IL+eLP+jpJAbYW9C+KNKofZtS6V6R0uzlqTOsEdZvwxZ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