943,708 Members | Top Members by Rank

Ad:
  • ColdFusion Discussion Thread
  • Marked Solved
  • Views: 1872
  • ColdFusion RSS
Sep 11th, 2009
0

Simultaneous Data Update - "Record Locking"

Expand Post »
What is the best way to update a record when 2 users of my site happen to edit it simultaneously?

For example, assume the following scenario:
Let's say users John Doe and Jane Doe log into my site and happen to view the below record simultaneously.
---------------------------------------------------------------------------------
Bruce Wayne | Gotham City | (910)000-0000
---------------------------------------------------------------------------------
If John edits the above phone number to (910)000-0001 and Jane changes it to (910)000-0002 - at the same time - what value do I update the DB with?

How do I prevent users overwriting each others' updates? Is something like <cflock> useful in this case or is it purely an SQL thing?

Thanks!
Last edited by SQL_n00b; Sep 11th, 2009 at 10:46 am.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
SQL_n00b is offline Offline
23 posts
since Apr 2009
Sep 11th, 2009
0

Re: Simultaneous Data Update - "Record Locking"

The lock is written into the query. You'll need to check into the correct syntax for your specific database.
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ColdFusion Forum Timeline: CFGrid and checkboxes
Next Thread in ColdFusion Forum Timeline: CFQUERY





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC