ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Parkinson" <pa...@avaning.com>
Subject RE: MySQL related question - constraint violation
Date Thu, 06 Dec 2007 21:36:10 GMT
HI Toby:

Yes - the exact same SQL script is used to set up both databases (and
yes - InnoDB).

Same SQL script to set up the databases and tables (and created from
scratch each time). Same Java code unit tests - the only difference is
Debian (5.0.32) as opposed to Windows/Mac (5.0.45).

Weird, huh?!


-----Original Message-----
From: Toby Thain [mailto:toby@smartgames.ca] 
Sent: Thursday, December 06, 2007 3:15 PM
To: user-java@ibatis.apache.org
Subject: Re: MySQL related question - constraint violation

On 6-Dec-07, at 11:46 AM, Brian Parkinson wrote:

> Hello -
> Wondering if someone out there has some MySQL experience - running  
> into
> a weird issue, and I'm stumped. This is perhaps not exactly an iBATIS
> issue, but I received no response over at the MySQL forums, so it's
> worth a shot:
> I have a very simple data model working in iBATIS (getting familiar  
> with
> this, and enjoying how it's put together). It works on Windows and Mac
> OS X, with MySQL version 5.0.45.
> For our deployment, we're using Debian 5.0.32.
> When I run my unit tests on the Debian box, I get foreign key  
> constraint
> violations which I do not get on the Windoze or Mac box.

Are they all using the same storage engine (differing defaults)?  
InnoDB checks such constraints, other engines generally do not.


> To wit:
>     [junit] ------------- Standard Output ---------------
>     [junit] --- The error occurred in
> com/ecobee/foundation/ibatis/SqlMapThermostat.xml.
>     [junit] --- The error occurred while applying a parameter map.
>     [junit] --- Check the Thermostat.LocationParameterMap.
>     [junit] --- Check the statement (update failed).
>     [junit] --- Cause:
> com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
> Cannot add or update a child row: a foreign key constraint fails

View raw message