Re: data persistence problem with Class::DBI
[prev]
[thread]
[next]
[Date index for 2005/04/14]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Paul Johnson wrote:
> On Thu, Apr 14, 2005 at 02:46:39PM -0400, Eric W. Bates wrote:
>
>
>>We're using Class::DBI in a mod_perl context and all is working quite
>>well. However, sometimes a CDBI object persists with old data after the
>>record has been updated. Hitting apache with a 'graceful' fixes it.
>>
>>We have separate handlers for displaying and editing the records; so I'm
>>assuming that the copy of the object used in the display handler is
>>persisting between accesses in spite of the handler's code
>>reinstantiating the object with a retrieve().
>>
>>Anybody dealt with this?
>>
>>Think it's a feature of Ima::DBI or some other part of Class::DBI?
>
>
> Take a look at UNIQUENESS OF OBJECTS IN MEMORY in the Class:DBI manpage.
> I had a very similar problem. In my case I think the object is
> persisting because it is being accessed from a TT2 page and I suspect
> TT2 is creating a closure, but I haven't tracked the reasons fully.
You are correct. We are using TT2.
> I fixed the problem with a call to clear_object_index at the start of
> the handler. I'd be pleased to hear of a slightly more subtle approach
> though.
Thanks. I'll let you know how that works out.
- --
Eric W. Bates
ericx@xxxxxxxx.xxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCXuibD1roJTQ4LlERAuyUAKDIpip4+ysaqbuDs5jtKrcMXHTcKACgmgFL
G5Ik3UqTdZGxq74GEIkzNIc=
=SMIQ
-----END PGP SIGNATURE-----