commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwaldh...@apache.org
Subject cvs commit: jakarta-commons/pool/src/java/org/apache/commons/pool/impl GenericKeyedObjectPool.java GenericObjectPool.java
Date Sat, 10 Aug 2002 21:13:27 GMT
rwaldhoff    2002/08/10 14:13:26

  Modified:    pool/src/java/org/apache/commons/pool/impl
                        GenericKeyedObjectPool.java GenericObjectPool.java
  Log:
  fix bug noted by Patrice Thiebaud, in which Evictor (when running) would evict all object
when _minEvictableIdleTime is non-positive
  
  Revision  Changes    Path
  1.6       +6 -5      jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java
  
  Index: GenericKeyedObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GenericKeyedObjectPool.java	1 May 2002 14:43:15 -0000	1.5
  +++ GenericKeyedObjectPool.java	10 Aug 2002 21:13:26 -0000	1.6
  @@ -1046,7 +1046,8 @@
                                   // if the objcursor has a previous object, then test it
                                   if(objcursor.hasPrevious()) {
                                       ObjectTimestampPair pair = (ObjectTimestampPair)(objcursor.previous());
  -                                    if(System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis)
{
  +                                    if(_minEvictableIdleTimeMillis > 0 &&
  +                                       System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis)
{
                                           try {
                                               objcursor.remove();
                                               _totalIdle--;
  
  
  
  1.6       +12 -11    jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java
  
  Index: GenericObjectPool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/pool/src/java/org/apache/commons/pool/impl/GenericObjectPool.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GenericObjectPool.java	1 May 2002 06:02:34 -0000	1.5
  +++ GenericObjectPool.java	10 Aug 2002 21:13:26 -0000	1.6
  @@ -918,13 +918,14 @@
                                       cursor = (CursorableLinkedList.Cursor)(_pool.cursor(_pool.size()));
                                   } else {
                                       ObjectTimestampPair pair = (ObjectTimestampPair)(cursor.previous());
  -                                    if(System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis)
{
  -                                        try {
  -                                            cursor.remove();
  -                                            _factory.destroyObject(pair.value);
  -                                        } catch(Exception e) {
  -                                            ; // ignored
  -                                        }
  +                                    if(_minEvictableIdleTimeMillis > 0 &&
  +                                       System.currentTimeMillis() - pair.tstamp > _minEvictableIdleTimeMillis)
{
  +                                       try {
  +                                           cursor.remove();
  +                                           _factory.destroyObject(pair.value);
  +                                       } catch(Exception e) {
  +                                           ; // ignored
  +                                       }
                                       } else if(_testWhileIdle) {
                                           boolean active = false;
                                           try {
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message