You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by dl...@apache.org on 2001/10/17 18:37:26 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/util/db IDBroker.java

dlr         01/10/17 09:37:26

  Modified:    src/java/org/apache/turbine/util/db IDBroker.java
  Log:
  Patch by J.C. <j_...@mac.com>:
  
  If the system clock is set back at any point while your app is running, and an object is created before the "original" time, the "timeLapse" value would be negative, which would make the "clever quantity" negative.
  
  Not good.
  
  Revision  Changes    Path
  1.2       +2 -2      jakarta-turbine-2/src/java/org/apache/turbine/util/db/IDBroker.java
  
  Index: IDBroker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/util/db/IDBroker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -u -r1.1 -r1.2
  --- IDBroker.java	2001/08/16 05:09:47	1.1
  +++ IDBroker.java	2001/10/17 16:37:26	1.2
  @@ -108,7 +108,7 @@
    *
    * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
    * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
  - * @version $Id: IDBroker.java,v 1.1 2001/08/16 05:09:47 jvanzyl Exp $
  + * @version $Id: IDBroker.java,v 1.2 2001/10/17 16:37:26 dlr Exp $
    */
   public class IDBroker
       implements Runnable, IdGenerator
  @@ -493,7 +493,7 @@
               long thenLong = lastTime.getTime();
               long nowLong = now.getTime();
               int timeLapse = (int)(nowLong-thenLong);
  -            if ( timeLapse < sleepPeriod )
  +            if ( timeLapse < sleepPeriod && timeLapse > 0 )
               {
                   Log.info("Unscheduled retrieval of more ids for table: " +
                            tableName);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org