Is there a way to simulate this? maybe run 2 templates and put some sleep code in between so I can see that it's not getting the same record twice?
> -----Original Message----- > From: Jochem van Dieten [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 08, 2006 4:56 PM > To: CF-Talk > Subject: Re: cross server locking > > Russ wrote: > > Will there not be a race condition there? If 2 servers run the same > code at > > the same time, wouldn't' they be working with the same set of records? > > Initially in the big select they can both get the same set of > primary keys, but inside the loop they can not get the same records. > > > > I'm > > not really sure if and how "FOR UPDATE NOWAIT" solves that? > > In the loop they wait for eachother because that select locks the > record with the FOR UPDATE statement. The NOWAIT modifier is > added so that the second select doesn't wait for the first one, > but fails immediately. The failure is handled through the > try/catch and the second thread moves on to the next record. > > Try it :) > > Jochem > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231681 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

