Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1082
How to manage "Last in wins" method in WinSchedule ?
posted

Hi All,

When multiple users attempt to modify data at the same time, controls need to be established in order to prevent one user's modifications from adversely affecting modifications from simultaneous users.

In general, there are three common ways to manage concurrency in a database:

  • Pessimistic concurrency control - a row is unavailable to users from the time the record is fetched until it is updated in the database.
  • Optimistic concurrency control - a row is unavailable to other users only while the data is actually being updated. The update examines the row in the database and determines whether any changes have been made. Attempting to update a record that has already been changed results in a concurrency violation.
  • "Last in wins" - a row is unavailable to other users only while the data is actually being updated. However, no effort is made to compare updates against the original record; the record is simply written out, potentially overwriting any changes made by other users since you last refreshed the records.

 

How to handle "Last in wins" concurrency  method  in WinSchedule control? Can someone give me an example code?   

try

{

     this.DataAdapterForAppointments.Update( this.DataSet,  WinScheduleDatabaseSupportBase.APPOINTMENTS_TABLE_NAME);

}

catch (DBConcurrencyException dbcx)

{

    // How to handle "Last in wins" concurrency method?

    // Can someone give me an example code

}

Thanks in advance, Lello

 

 

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    This question is a general one on the subject of how to properly handle data concurrency exceptions; the following MSDN article provides some guidance.

    How you enforce user access restrictions is not something that the WinSchedule data binding layer gets involved with - it is a function of the data source itself.

Children