Ed Leafe wrote: > On Nov 15, 2007, at 2:53 PM, Uwe Grauer wrote: > >> When i call JnpBizobj.delete() Dabo deletes the parent record prior >> to deleting the childs when JnpBizobj.deleteChildLogic = >> REFINTEG_CASCADE which isn't allowed if your firebird database >> contains >> foreign key constraints (See dBizobj.delete()). > > So let me be sure that I understand this: your database is > configured with the equivalent of REFINTEG_RESTRICT, but you want it > to cascade its deletes, so you have your bizobj configured with > REFINTEG_CASCADE. You want a way to somehow easily get the bizobj to > overrule the database's constraints by coding a reverse cascading > delete in the bizobj. Is that correct? >
Yes > May I ask why you can't configure your database to use the > referential integrity constraints that would match the behavior you > want? From the ibphoenix site: BTW, the main site for firebird is firebirdsql.org The FAQ is on firebirdfaq.org > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ... > So if you were to configure your table's FK to use ON DELETE > CASCADE, there would be no issue, as the database logic and the > bizobj logic will match. > Yes, but there are still issues. Consider a table USR which has a foreign key to JNP. If the user wants to delete a JNP it wouldn't be allowed to do so if there still is a foreign key form a different table (USR). The database has to maintain data integrity, it doesn't know about all rules for the business logic. So i use the app layer to decide when and how objects can be deleted (for example). That's why i don't like to have the database delete objects which are not related to the current context of the application forms. The app logic can explicitly override the integrity constraints of the database if it knows about how to do so. Uwe _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]
