On Nov 26, 12:29 pm, Rob <[EMAIL PROTECTED]> wrote:
> I did use my own slightly modified version of TreeBehavior->recover()
> to repir tree and it was succesful, thou  for 5000 acos it had done
> 500k queries to database and took about an hour to complete so i guess
> its not optimized at all.
> Another thing is i cant afford repairing broken tree every time some1
> does simultaneous actions.
> Im aware its not a cakephp related problem but PHP in general (lack of
> threads synchronization) but maybe this can be solved on framework
> level.

You could consider wrapping (whatever) process in lock tables and/or
transactions and checking for errors - or by simply creating a lock
file and checking for its existence before starting a process. It is a
consideration to try and prevent such race conditions - but for 1.2 :)

No the recovery method isn't optimized, but then, it's not written to
be in daily use. The way it works is to ignore your hierarchy,
generate a flat, valid, tree structure - and then move things under
the correct parent one node at a time, hence it is quite intensive
(but also, and most importantly: reliable). Feel free to tinker and
submit a patch if you find a way to speed it up.

hth,

AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to