try using a CFTRANSACTION like this...

<cftransaction>
        <cfquery name="">
        EXECUTE sp_newmeal....
        </cfquery>
</cftransaction>

It is my understanding that the CFTRANSACTION will single thread ALL
requests to the specified DB (instead of just row-level or table-level
locks).  That will prevent concurrent threads from inserting the same ID

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 20, 2002 8:38 AM
To: CF-Talk
Subject: Annoying DB question


I'm having an issue
"Error","TID=361","05/20/102","10:54:12","ODBC Error Code = 23000 (Integrity
constraint violation)<P> [Microsoft][ODBC SQL Server Driver][SQL
Server]Violation of PRIMARY KEY constraint 'PK benefit'. Cannot insert
duplicate key in object 'tblBenefit'.<P><P> SQL = "sp_newmeal" "

Heres whats happening we have 8 rows in the db that hold meal plans
when we change them we remove the old plans and insert new plans
sometimes if you hit refresh enough it causes a ERROR above to be thrown.
What i did was put the enter thing into a transaction with 
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

and it still throws the error when the SQL notes say it shouldnt happen like
that 
any ideas? thanks


Bill Wheatley
Senior Database Developer
Macromedia Certified Advanced Coldfusion Developer
EDIETS.COM
954.360.9022 X159
ICQ 417645


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to