Sunday, June 29, 2014

Re: database table locking across supported database

Now you changed your requirement to not only being one column.

Does you solution include a lot of transactions taking place in the table, in your case "x"?

Locking "x" would just make it a slower solution in total for other users.

Have you considered another solution, that makes your calculations independent of what others are doing in table "x"?

Enjoy, John

Ps. if your original post is a request for a feature, then probably the CakePHP core group is a better forum.
Please correct me if I am wrong :)

On Sunday, 29 June 2014 18:27:05 UTC+3, Prashant wrote:
Hi,

On Sun, Jun 29, 2014 at 8:45 PM, John Andersen <j.ande...@gmail.com> wrote:
>
> Put a unique index on your receipt_number column, then when you
> grab the highest receipt_number, increases it and saves it, you will either
> succeed or get an error.

Thats one way of doing it.

But I have faced this issues at few other places also. For eg : I want
to read a huge number of rows from table 'x' and I want to do some
calculations on it and then save the result in the table 'y'. Now I
dont want anyone else to add or remove removes from the table 'x'
until I have finished writing the result to table 'y'.

Having support for locking will really help and make it easier for me
do deal with the concurrency issues.

Regards.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: