Menu

#2 Bug in concurrency control wrap-around

closed-accepted
General (8)
5
2004-04-27
2004-04-27
No

Version 1.0.2

The concurrency control value in any object will
wrap-around before the database column does.

I found the bug in file PersistenceBroker.cs, line 487:

long version = 1 + Convert.ToInt64( fm.GetValue( obj ) );
// handle wrap-around of the version counter
if( (fm.Type.Equals( typeof(int) ) && version ==
int.MaxValue) || (fm.Type.Equals( typeof(long) ) &&
version == long.MaxValue) )
version = 1;

The following lines will fix that bug:

long version = Convert.ToInt64( fm.GetValue( obj ) );
// handle wrap-around of the version counter
if( (fm.Type.Equals( typeof(int) ) && version ==
int.MaxValue) || (fm.Type.Equals( typeof(long) ) &&
version == long.MaxValue) )
version = 1;
else
version += 1;

Discussion

  • Morten Mertner

    Morten Mertner - 2004-04-27
    • status: open --> closed
     
  • Morten Mertner

    Morten Mertner - 2004-04-27
    • assigned_to: nobody --> mnmr
    • status: closed --> closed-accepted
     
  • Morten Mertner

    Morten Mertner - 2004-04-27

    Logged In: YES
    user_id=974288

    Thanks!

    This fix has been applied in Subversion and will be in 1.0.3.

     

Log in to post a comment.