You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Hello <da...@fr.thalesgroup.com> on 2003/12/15 11:23:06 UTC

synchronised method in javascript for petstore flowscript sample

Hi,

I've studied the Petstore flowscript sample in coocon 2.1.3.
While inserting new Element in Database whith javascript method, first 
we select the max of the id in the table, then we insert a new element 
with an id:
new_id=max(id) +1.
It seems a problem can occur because, the two requests are  not 
transactionnal, and someone can insert a new element between the
selection of the max(id), and the insertion, and the database will be 
corrupted(2 elements with same id).
I'd like to know if there a way to put the javascript method wich do the 
insertion "synchronised", or another way to do several database requests 
in a single transaction.

Thanks,
David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org