[Dbix-class] Paging all re nested sets

Sebastian Willert willert at gmail.com
Thu Apr 10 18:53:42 BST 2008


On Thu, 2008-04-10 at 18:41 +0100, Matt S Trout wrote:
> On Mon, Apr 07, 2008 at 04:12:27PM +0200, Sebastian Willert wrote:
> > 
> > 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).
> 
> Why locking support? SELECT FOR UPDATE should do the trick shouldn't it?

In MySQL with InnoDB yes, in MySQL with MyISAM and SQLite no, even
crashing the process. No idea about all the other DBs out there. If
'SELECT FOR UPDATE' is considered compatible enough, I will gladly use
it directly with a big fat warning in the POD. MyISAM and SQLite could
be regarded as unfit for this purpose without anyone shedding a tear
IMO.

So, people with easy access to other DBs, speak up.

Cheers, Sebastian




More information about the DBIx-Class mailing list