If you are using MS SQL you can try to use an identity column for the
primary key.  This should get you around any primary key conflicts when
inserting.

Rather than generating a unique ID within the code allow the database to
do it for you.

If you cannot simply use an identity column, reply and I can send you a
MSSQL stored proc that will do key generation for you without
contention.

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