I have a web app that can be accessed by many users at the same time.
I have a table with a field wich has a counter on the next invoice
number. Lets call if invoicenumbers (this field cant be
auto_increment)
And then i have another table where i need to store the invoices data
Lets call it invoices
So lets see:
A user enters Save Invoice, i need to do a SELECT or FIND to the
invoicenumbers to get the next invoice number and then an UPDATE to
invoicenumbers to set the field counter = counter+1.
But maybe between the select and the update another user Saves another
Invoice wich will do the same (SELECT and the UPDATE) and that is a
remote posibility that they both get the same Invoice Number and then
both UPDATE the table increasing the counter by 2.
I hope i made myself clear.
Thanks in advance ... aad
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment