Register
Login
Home
Code Complete
Download
Purchase
Your Cart
Forum
Services
Contact us
Tuesday, January 06, 2009
Web
Site
Forum
Unanswered
Active Topics
Forums
Search
Members
Forums
>
Code Complete
>
Support
Optimistic locking in the beta release
Last Post 14 Oct 2008 05:33 PM by
eurowise
. 3 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
TerryH
New Member
Posts:7
12 Oct 2008 10:39 PM
Can you please explain how the optimistic locking option found on the "Configure the project properties" works. The documentation does say that if the tables include a timestamp that optimistic locking can be enforced, but doesn't offer any further insite on this feature.
eurowise
Basic Member
Posts:107
13 Oct 2008 07:58 AM
What it basically does is this. By selecting this option, CodeComplete adds another parameter in the where clause of the update command to check if the timestamp has changed, like this (Projects table in the PTracker)
UPDATE [Projects] SET [Name]=@Name, [Started]=@Started, [Ended]=@Ended, [Description]=@Description Where [Id]=@Id AND [LastChanged]=@LastChanged
Philip
TerryH
New Member
Posts:7
13 Oct 2008 10:49 PM
How does it know which timestamp field to use in the table ?
Does the field have to be called "LastChanged" ?
eurowise
Basic Member
Posts:107
14 Oct 2008 05:33 PM
That's the magic of Code Complete, it just knows! Seriously, Code Complete just uses the database schema information. It does not have to be called LastChanged.
Philip
You are not authorized to post a reply.
Code Complete
--Dedicated to the latest news and announcements
--Tips and Tricks
--Code Complete Templates
--Testimonies
--Wish list
--General
--Support
Default Group
--Default Forum
Forums
>
Code Complete
>
Support
Active Forums 4.0
(c) 2009 - Eurowise Soft - Code Complete, The code generator.
|
Terms Of Use
|
Privacy Statement