[Dbix-class] Paging all re nested sets

Sebastian Willert willert at gmail.com
Mon Apr 7 15:12:27 BST 2008


On Sun, 2008-04-06 at 20:41 +0100, Matt S Trout wrote:
> On Fri, Apr 04, 2008 at 04:56:57PM +0200, Sebastian Willert wrote:
> > 
> > On Thu, 2008-03-27 at 21:53 +0000, Matt S Trout wrote: 
> > > A bunch of you have asked about nested sets, tried to implement them
> > > yourself, been told about this, started on ::Tree implementations, not
> > > had time to carry on, got stuck, forgotten, then somebody else has asked.
> > 
> > Guilty as charged, your honor. I still have an half-backed
> > implementation of DBIx::Class::Tree::NestedSet laying around, that I've
> > almost forgotten about. In my defense, I'd stopped working on it because
> > I believe we'd need a good RDBMS-independent locking mechanism (and an
> > live object index for bonus points) for any nested-set implementation to
> > become production-ready. In difference to adjacency lists, nested sets
> > tend to die a horrible dead when used without a good locking strategy
> > (preferably row-based).
> 
> And as I said at the time to you, you believe wrong and could we please
> just have an implementation that mostly works first?
> 
> You basically wasted your time disappearing down a rathole that a lot of
> yours consumers won't need.
> 
> Yes, without an LOI you can end up with dirty objects. But you can always
> end up with dirty objects in DBIC; that's how it works.

You are building a straw-man here. I blocked on locking support, not on
LOI. The sane approach here would be to take Moritz suggestion with
locking-support factored out into RDBMS-specific subclasses (or, even
better, delegated to them to avoid mocking around with ISA).

I'll happily provide the statements needed for MySQL InnoDB and help out
with the factoring when I'm done with the work-related stuff that's
overwhelming me right now ... should be in one or two weeks.

Cheers,
  Sebastian





More information about the DBIx-Class mailing list