Re: Rows as singletons

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Rows as singletons

Matt S Trout
On Tue, Jun 24, 2008 at 06:46:38PM +0100, David Cantrell wrote:
> I've been mumbling on IRC over the last week or two about rows being
> singletons when they get loaded into memory.  This is mostly because,
> when writing tests for a DBIx::Class based project I got irritated when
> I had two references to the same row hanging around in memory, update()d
> one of them, but the other still had old data in it.
>
> Here's my fix:
>   http://www.cantrell.org.uk/david/private/SingletonRows.pm

This is probably something else that would work well with the ResultSource
refactor I just mentioned upthread wrt caching stuff.

Hm. Wouldn't you be better using the "keep weak refs and then clean 'em
up via a mark-and-sweep every so often" approach that CDBI's LiveObjectIndex
does? The whole refcounting thing seems like much more work, and maybe
even -more- fragile than the LOI used to be.

--
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...