Thanks a lot to the two of you ...

AD7six code had some problems with the foreign key I'm using
(something I omitted for simplicity's sake :) ... and after I fixed it
I saw grigri's code which worked right out of the box. Very nice
indeed, thanks again!

As grigri mentioned, it doesn't use transactions or locks so I did
manage to break the proper jobcolumn_position sequence. In order to do
so, I wrote a test which randomly inserts and deletes jobs into the
columns.

If I run this this in Firefox only, everything works like a charm ....
but when I do a large number of inserts/deletes and let the script run
from Opera simultaneously the position gets corrupted.

So what would be the best way to solve this with transactions? Make
the jobcolumn_position an UNIQUE INDEX and catch the error on save
(.... and how do I distinguish it from a normal "return false" on
Model->save()?).

If I don't UNIQUE then it would be quite a pain finding out if a
jobcolumn_position really is unique ...

Open for any suggestions ...

Thanks in advance

wirtsi




On 11 Feb., 11:40, grigri <[EMAIL PROTECTED]> wrote:
> I use this:http://bin.cakephp.org/view/634962728
>
> It's not based on the tree behavior [written from scratch], but it's
> not transactional and I've no idea of its performance on large tables
> as I've only ever used it on tables with less than 100-200 rows.
>
> On Feb 11, 10:20 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Feb 11, 11:13 am, wirtsi <[EMAIL PROTECTED]> wrote:
>
> > > Hi ...
>
> > > I'm aware that this is not 100% Cake specific ... but I got to deal
> > > with it atm in my Cake project so I hope you guys can help me out.
> > > What I got here is:
>
> > > A table containing around 1000 jobs (table framejobs) that need to be
> > > in a specific order. For that reason I created a table column called
> > > jobcolumn_position which I made a UNIQUE INDEX. Storage is MyISAM.
> > > Version is 1.2.0.5875 pre-beta.
>
> > I use this:http://bin.cakephp.org/view/1515101211
>
> > Which is a shameless, slimmed down tree behavior (as is obvious from
> > the unedited doc blocks).
>
> > hth,
>
> > AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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