Hey all,
In an inherited application, we have the following pseudo-code - two
queries, one right after the other:
<cfquery>
DELETE FROM table
WHERE ID = '#myidstring#'
</cfquery>
<cfquery>
INSERT INTO table
(ID)
VALUES
('#myidstring#')
</cfquery>
Given this scenario, it would seem that you could never have a duplicate key
error, since you are deleting any rows with the string in question, before
trying to do an insert. However, occasionally this throws a "duplicate key"
error.
Is it possible that somehow the insert occasionally runs before the delete?
Do I need to use cftransaction to ensure the proper order of execution here?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288115
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4