Development

Changeset 5146

You must first sign up to be able to contribute.

Changeset 5146

Show
Ignore:
Timestamp:
09/16/07 17:03:49 (6 years ago)
Author:
fabien
Message:

fixed sfPropelOptimisticLockBehaviorPlugin: Problem when integer overflows (closes #2207 - patch from eckhofer)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelOptimisticLockBehaviorPlugin/lib/sfPropelOptimisticLockBehavior.class.php

    r2514 r5146  
    5050      // new lock version 
    5151      $setMethod = 'set'.$phpName; 
    52       $object->$setMethod($previousValue + 1); 
     52      $object->$setMethod(($previousValue + 1) % 128); 
    5353 
    5454      $criteria = $object->buildCriteria(); 
     
    6868      if (!$ret = BasePeer::doUpdate($selectCriteria, $criteria, $con)) 
    6969      { 
    70         throw new PropelException('Cannot update a stale object'); 
     70        throw new sfStalePropelObjectException('Cannot update a stale object'); 
    7171      } 
    7272