logo       

Re: [enhydra] DeleteCascade on PostgreSQL: msg#00013

java.enhydra.general

Subject: Re: [enhydra] DeleteCascade on PostgreSQL

Hi,

Some notes regarding delete cascade option in DODS. I hope it helps.
The class <table_name>DO.java (DODS generated) provides java code for
cascade delete of DOs.

In dbVendorConf files there is a parameter

<DeleteCascade>true</DeleteCascade>

If this parameter is set to true it means that sql that handles delete
cascade will be generated. The java code in <table_name>DO.java class is
always generated. When delete cascade happens, if this parameter is set to
true, sql code is executed (db will delete references), the java code (in
DODS generated classes) is not executed, and the cascade deleted DOs are
marked as deleted.

If DeleteCascade is set to false, the sql code is neither generated, nor
executed. The java code (DODS generated classes) will be executed, and
cascade references are deleted, using DODS.

But if you generate sql stataments (using DODS) with DeleteCascade = false,
and during runtime change DeleteCascade = true, your application should
delete DO's references because DODS will not delete references
(DeleteCascade = true, it means db will delete them) and db will not delete
(because sql scripts for delete cascading are not created, DeleteCascade =
true).

Regards,

Sinisa



----- Original Message -----
From: "Ricardo Tedim" <rjtedim@xxxxxxxxxxxx>
To: <enhydra@xxxxxxxxxxxxx>; <dods@xxxxxxxxxxxxx>
Sent: Wednesday, July 13, 2005 4:44 PM
Subject: [enhydra] DeleteCascade on PostgreSQL


> Hi,
>
> I'm doing some perfomance tests in a project running on top of the new
> Enhydra 6.4.1 (Tomcat version) and a PostgreSQL DB engine (7.3.9). I've
> noticed that on the DODS configuration that was installed with this
> Enhydra, the DeleteCascade parameter for PostgreSQL is set to false.
> This means that the DB reference integrity will be guaranteed by the
> data layer generated by DODS, and for what I understood this is done by
> fetching (on DB) the objects that have references to the object being
> changed, and performing on them the required changes (if needed). So for
> instance if I have a DO named A that references B and I try to delete B
> using the DODS layer, this will result in following SQL operations:
>
> 1. Select B from DB and then delete it by invoking the delete method on
> its DO.
> 2. Select A from DB (triggered by DODS)
> 3. Delete A and B from DB.
>
> If this integrity is guaranteed by the DB engine, the 2nd operation and
> part of the 3rd will be automatically performed by the DB engine
> resulting in a performance improvement. This is what I wanted to explore
> in the project I'm in, but first I would like to know from you if
> there's any known issue related to the setting of this parameter to true
> (since by default it is setted to false).
>
> Thanks in advance,
> Ricardo Tedim
>
>
>
>


----------------------------------------------------------------------------
----


>
> --
> You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx
mailing list.
> To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>



--
You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing
list.
To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise