Difference: ProgrammingNotes (7 vs. 8)

Revision 820 Jan 2003 - TobyCabot

Line: 1 to 1
 
META TOPICPARENT name="TechTips"
(back to TechTips)
Line: 18 to 18
 Code Reviews - are extremely important because they actually find bugs, but I've been looking for a way to speed them up. This might be it: a tool that allows people to input their comments ahead of time. http://codestriker.sourceforge.net/

Go To Statement Considered Harmful - Edsger Dijkstra's classic. http://www.acm.org/classics/oct95/

Added:
>
>

Managing Concurrency

If you're building a system that has a database and different processes operating on the objects in that database then you'll probably want to come up with a strategy for dealing with concurrent access to specific objects. There are a couple of approaches: hard lock, soft lock, merge.

Hard Lock means that you take a database lock when you read an object and hold it until your update completes. If everyone uses the same logic then the 2nd person who tries to update the object will fail, or wait until you've finished and committed your changes.

Soft Lock means that you'll mark the record as being in the process of being updated, and report this status back to the user. The 2nd person who tries to update the object will get a message that the object is being updated, but can proceed (at the risk of one of the users losing their changes).

Merge means that you note the version of the row that you read and fail on the write if that version has changed in the mean time. This is something like CVS's approach - it works well when there are few collisions but requires some conflict-resolution logic to really work well.

View topic | History: r25 < r24 < r23 < r22 | More topic actions...
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback