[Lazarus] New Mac OS X Scheme

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed Sep 10 02:18:02 CEST 2008

On 9/9/08, Michael Van Canneyt <michael at freepascal.org> wrote:
> Not if all foreign keys to the table have the cascade delete option specified,
>  then it is automatic. This is the option I most of the time use.

Thanks for the response.  After I sent the message, I thought this
might be an option as well. Thought I have never used it, it sounds
dangerous. :-)

>  When you delete AdresType record with ID 1, all ADDRESSES records that have
>  AddressType =1 will automatically be deleted.

OK, now the big question which might affect you as well.  How do you
translate this to tiOPF based applications?  What if you delete an
AddressType from the database (with cascade delete), but still have
some objects (Contacts) in memory. They wouldn't know about the
cascade delete. In tiOPF it's the Object that requests a delete and
only for that specific object. A cascade delete can delete a lot of
objects/records, not just itself.  I guess some delete visitor would
have to be launched as well on any loaded (in memory) objects.

Umm... I'll raise this issue in the tiOPF newsgroup as well.

> Some people do this, but I recommend against it, as you end up with a lot
>  of junk in your database if it is actively used.

This is what I'm worried about as well... Lots of waisted data lying around.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the Lazarus mailing list