[T2-users] Re: [Dbix-class] Live object index support ported

Jean-Louis Leroy jll at soundobjectlogic.com
Sun Aug 14 20:00:22 CEST 2005


> Tangram::Storage has a cache in ->{objects}, a hash from the OID (class
> ID + primary key ID) to the object.  Using Scalar::Util qw(weaken), this
> can be a "weak" reference that drops once the object falls out of scope.
>
> However, it is a bad idea to keep these objects around after you commit,
> unless you are very careful to implement some kind of object versioning
> system (ie, each record has a version number that must match before
> updating can succeed).

That's exactly what we had in the Appeal Court Automation Project,
where Tangram was born back in 1996. It was implemented in a subclass
of Storage - if memory serves. All UPDATES were complemented with a
' AND version = xxx'; if the modified rowcount was zero an exception
was thrown and the Controllers suggested a refresh to the user. I
think there must still exist a 'refresh' or 'reload' method somewhere
in T2...
-- 
Jean-Louis Leroy
Sound Object Logic
http://www.soundobjectlogic.com



More information about the Dbix-class mailing list