Re: [enhydra] DeleteCascade on PostgreSQL
Ricardo Tedim <[email protected]> Thu, 14 Jul 2005 15:24:47 +0100
| Newsgroups | gmane.comp.java.enhydra.dods |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format... ------------=_1121350858-4169-91 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Sinisa. Thanks for your answer. I understand the concept fairly well. The doubt I had was if there was any known problem with using deletecascade on PostgreSQL (because it is set to false by default on the DODS installation). For what you told me, I believe there isn't any problem. However, with your explanation, I have now another doubt: in runtime where do I say that deletecascade is supported by postgres? Is it on the config file for each application (I couldn't find anything on the DODS docs for this)? The PostgreSQLConf.xml should also be present on the deploy environment? Regards, Ricardo Sinisa Milosevic wrote: >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" <[email protected]> >To: <[email protected]>; <[email protected]> >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 >> >> >> >> >> >>------------------------------------------------------------------------ >> ------------=_1121350858-4169-91 Content-Type: text/plain; name="message-footer.txt" Content-Disposition: inline; filename="message-footer.txt" Content-Transfer-Encoding: 8bit -- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws ------------=_1121350858-4169-91--