db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Scott" <deni...@gmail.com>
Subject Re: Is it Possible to Turn off Referential Constraints for a DBUNIT Load?
Date Mon, 16 Oct 2006 11:44:50 GMT
On 16/10/06, Chris Barham <cbarham@pobox.com> wrote:
> 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
>

And to be fair, DB2 and Oracle offer the same sort of functionality
via the SET CONSTRAINTS statement. In Oracle's case, the constraints
are checked at the end of the transaction -- so if you load a million
rows, you're not checking row-by-row.

The reason people typically want to temporarily disable constraints
for a load is to increase the speed with which you can load data. It
certainly makes a big difference if you're loading a data warehouse
with a terabyte of data; that's probably not a space where Derby is
going to come into play, but a common enough need for other databases.

So Chris, I think your question is perfectly reasonable. And, like
Mamta, I think the answer is that Derby currently doesn't offer this
functionality.

Dan

Mime
View raw message