Chili.Opf3 Send comments on this topic.
ConcurrencyManager Property
See Also  Example
Chili.Opf3 Namespace > ObjectContext Class : ConcurrencyManager Property




Specifies the class that implements the IConcurrencyManager interface.

Syntax

Visual Basic (Declaration) 
Public Property ConcurrencyManager As IConcurrencyManager
Visual Basic (Usage)Copy Code
Dim instance As ObjectContext
Dim value As IConcurrencyManager
 
instance.ConcurrencyManager = value
 
value = instance.ConcurrencyManager
C# 
public IConcurrencyManager ConcurrencyManager {get; set;}
Managed Extensions for C++ 
public: __property IConcurrencyManager* get_ConcurrencyManager();
public: __property void set_ConcurrencyManager( 
   IConcurrencyManager* value
);
C++/CLI 
public:
property IConcurrencyManager^ ConcurrencyManager {
   IConcurrencyManager^ get();
   void set (IConcurrencyManager^ value);
}

Return Value

Returns the IConcurrencyManager of the ObjectContext or null if no manager has been specified.

Example

The following example shows how to set the Md5ConcurrencyManager.
C#Copy Code
// Creates a new ObjectContext that uses an MsSql Server as storage. 
ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "",  
    "localhost", "application")); 
// Set the ConcurrencyManager. 
context.ConcurrencyManager = new Md5ConurrencyManager(); 
    

Remarks

The IConcurrencyManager checks if somebody else has changed the object in the meantime (in the time it has been in memory). It throws a ConcurrencyException if somebody else altered the object in the meantime. If the program using the framework is not the only one working on a storage it is always required to set a IConcurrencyManager.

Requirements

Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family

See Also