One more thought for you...

Even when you do solve your duplicate key problem it may still be
possible for a single user to do a redundant submission by hitting the
save button really quickly... which could potentially cause the event
logic to insert multiple distinct records even if you are no longer
having duplicate key issues.

I only mention this because the problem that you describe and this one
can be related.

I have solved this by using javascript to do my form submissions (which
also works well for safety saves if the user enters a new URL, closes
the browser, etc), and/or I have also solved it without javascript by
tagging my forms with some additional hidden data, and then examining
that data immediately upon receipt of the event (if valid then I change
it immediately), and bypassing the remainder of the event if that
instance of the form had already been submitted.

If you search the turbine mailing list for sessionAccessCounter you will
find some other info about this...

Personally I like using a single source timestamp instead (such as from
a common server or database) no need to worry about incrementing
it...works well if the user likes to hit the back button, can be used
across different user sessions if two users are trying to update the
same record, etc.

Tony O.

-----Original Message-----
From: Keshav Murthy Srinivas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 24, 2006 6:56 AM
To: [email protected]
Subject: Multiple saves at same time

Hi,
   
  We have Registration form in our application developed using turbine
2.2, and on click of save button the data is getting saved  in MS SQL
database and a  unique registration ID is generated in the code and
saved in table and also displayed to the user. The table column in which
this ID is stored is also the Primary Key column. However if the save
button is clicked by multiple users at same time  we are getting
exception because of primary key violation.  My question is how can we
avoid getting this exception when multiple savings happen at same time?
   
  Regards,
  keshav

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to