Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0638592AC for ; Mon, 6 Feb 2012 12:19:13 +0000 (UTC) Received: (qmail 14861 invoked by uid 500); 6 Feb 2012 12:19:12 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 14830 invoked by uid 500); 6 Feb 2012 12:19:11 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 14819 invoked by uid 99); 6 Feb 2012 12:19:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 12:19:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbryanlewis@gmail.com designates 209.85.214.171 as permitted sender) Received: from [209.85.214.171] (HELO mail-tul01m020-f171.google.com) (209.85.214.171) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Feb 2012 12:19:04 +0000 Received: by obcuy19 with SMTP id uy19so11888452obc.16 for ; Mon, 06 Feb 2012 04:18:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=G3RuMFeOn/qg71m0DKFbTkJFrAtJjWjQ/WMgHxLxTrM=; b=Y6zpxw1N0fUTaan/NEaL8USFXeUZRijaH7qmSv9Y8fbcMAjsXSZeFTn8X1JrGGPsJs wQ8dxEf2Ait6S95B2wvLU8yV5v0gGJV70F2UAUI4suA/u8nCLiPHaVSIp9ssgyznoCZq z2Zy5MS0YShKRTdzs2eW/W3/pj7M+lzq2s78U= Received: by 10.182.41.98 with SMTP id e2mr16453166obl.68.1328530724247; Mon, 06 Feb 2012 04:18:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.122.65 with HTTP; Mon, 6 Feb 2012 04:18:24 -0800 (PST) In-Reply-To: <605526E6-72CF-4B2D-97A7-76766A951E74@earthlink.net> References: <1CAF0260-43A3-409E-9833-3A551EC5208A@earthlink.net> <605526E6-72CF-4B2D-97A7-76766A951E74@earthlink.net> From: Bryan Lewis Date: Mon, 6 Feb 2012 07:18:24 -0500 Message-ID: Subject: Re: Odd error To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=f46d0444eccde458a804b84aa96c --f46d0444eccde458a804b84aa96c Content-Type: text/plain; charset=ISO-8859-1 This error reminds me of something we see in our shop. If multiple related entities are being committed together, Cayenne can sometimes commit them out of order which can cause FK constraint violations. The commit order seems to be indeterminate; it can work as expected on a dev machine and fail in production. Look at the SQL issued just before the error. On one server you might see the packagetype being inserted before the product, but the other way around on the other server. If this is the problem, the fix is to subclass the AshwoodEntitySorter as has been discussed a couple of times in the list. On Sun, Feb 5, 2012 at 6:48 PM, Joe Baldwin wrote: > > Here is the current error (which is really odd because it is working just > fine on my dev server) > > com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: > Cannot add or update a child row: a foreign key constraint fails > (`eagle1_om28`.`product`, CONSTRAINT `product_ibfk_2` FOREIGN KEY > (`packageTypeOid`) REFERENCES `packagetype` (`oid`)) > --f46d0444eccde458a804b84aa96c--