Re: Dealing with database level updates

[prev] [thread] [next] [Date index for 2004/08/13]

From: Perrin Harkins
Subject: Re: Dealing with database level updates
Date: 16:35 on 13 Aug 2004
On Fri, 2004-08-13 at 08:59, dan@xxxxxxxxxx.xxx wrote:
> My first thought was to have a "session_id" field in my object, and
> make this a foreign key in the database using "ON DELETE SET NULL".
> That way, when the user
> logs out, the resource will automagically become "free" again.

That should be fine.  Or you could just do this from your perl code when
a user logs out.

> However, this system is clearly incompatible with Class::DBI keeping
> copied of Database data in memory :)

Class::DBI doesn't keep data in memory any differently from a standard
DBI app.  It follows normal Perl scoping rules.

For example:

sub foo {
    my $bar = Bar->retrieve(1);
    ... do something ...
}

$bar is now gone from memory.

- Perrin



Dealing with database level updates
dan 12:59 on 13 Aug 2004

Re: Dealing with database level updates
Perrin Harkins 16:35 on 13 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52