Dealing with database level updates
[prev]
[thread]
[next]
[Date index for 2004/08/13]
Hi there,
I have a table in Class::DBI that's modelling resources. I want to assign resources to users when they ask for them, ensure that a user always gets the same resource that they have "booked" every time they request one, and free those resources when the user logs out.
The users in question all have a session (as they've logged in) and this is stored in the database. The session does not know about, or have anything to do with Class::DBI.
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.
However, this system is clearly incompatible with Class::DBI keeping copied of Database data in memory :)
Is there a way to tell Class::DBI that a particular field, or even a particular kind of object is "volatile" - that is, it should not trust cached copies of this data?
Thanks,
Dan
|
Dealing with database level updates
dan 12:59 on 13 Aug 2004
|