cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Lewis <>
Subject Re: Odd error
Date Mon, 06 Feb 2012 12:18:24 GMT
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`))

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message