db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "BALDWIN, ALAN J [AG-Contractor/1000]" <alan.j.bald...@monsanto.com>
Subject RE: Is it Possible to Turn off Referential Constraints for a DBUNIT Load?
Date Mon, 16 Oct 2006 15:21:09 GMT
Chris,
Are you loading the data in the intial xml files in the correct order?
That makes a difference.  Lowest level tables should go at the top of
the file, so that they are inserted first in dbunit's
DatabaseOperation.INSERT operation, and they are deleted last in the
DatabaseOperation.DELETE_ALL operation.
Could this be your problem, or are you just trying to load up the
database without having to specifically load FK tables?  It can be a
pain, but it does result in a better test if everything is loaded
correctly.  

I've used DBUnit a lot with Derby, and I've never had the need to turn
off referential integrity as long as the xml files had all the necessary
data in them, and they were in the correct order.

Hope this helps.

-Alan-

-----Original Message-----
From: chas66@gmail.com [mailto:chas66@gmail.com] On Behalf Of Chris
Barham
Sent: Monday, October 16, 2006 6:07 AM
To: Derby Discussion; msegel@segel.com
Subject: Re: Is it Possible to Turn off Referential Constraints for a
DBUNIT Load?

On 10/16/06, Michael Segel <msegel@segel.com> wrote:
<snip>
> [mjs]
> If you think about it, you don't have to *have* referential
constraints on a
> table. They are placed there for a reason.
>
> So why do you want to load data that may violate them?

Because DBUnit is a very convenient way to put a database into a known
state, except when references become a problem for the flat file
nature of the source.  No other reason; I am not a mysql fanboy,
merely trying to get stuff done.

Chris

---------------------------------------------------------------------------------------------------------
This e-mail message may contain privileged and/or confidential information, and is intended
to be received only by persons entitled to receive such information. If you have received
this e-mail in error, please notify the sender immediately. Please delete it and all attachments
from any servers, hard drives or any other media. Other use of this e-mail by you is strictly
prohibited.


All e-mails and attachments sent and received are subject to monitoring, reading and archival
by Monsanto. The recipient of this e-mail is solely responsible for checking for the presence
of "Viruses" or other "Malware". Monsanto accepts no liability for any damage caused by any
such code transmitted by or accompanying this e-mail or any attachment.
---------------------------------------------------------------------------------------------------------


Mime
View raw message