Bug fix in Bean caching

This commit is contained in:
Ziver Koc 2015-12-15 21:43:58 +01:00
parent 47cfb895fb
commit ad970e3317
2 changed files with 2 additions and 2 deletions

BIN
Zutil.jar

Binary file not shown.

4
src/zutil/db/bean/DBBeanSQLResultHandler.java Normal file → Executable file
View file

@ -169,7 +169,7 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
} }
if( removed > 0 ) if( removed > 0 )
logger.info("DBBeanGarbageCollector has cleard "+removed+" beans from cache."); logger.info("DBBeanGarbageCollector has cleared "+removed+" beans from cache.");
} }
} }
@ -315,7 +315,7 @@ public class DBBeanSQLResultHandler<T> implements SQLResultHandler<T>{
// Check if the cache is valid // Check if the cache is valid
if( item != null ){ if( item != null ){
// The cache is old, update and return it // The cache is old, update and return it
if( item.timestamp+CACHE_TTL > System.currentTimeMillis() ){ if( item.timestamp+CACHE_TTL < System.currentTimeMillis() ){
// There is no ResultSet to update from // There is no ResultSet to update from
if( result == null ) if( result == null )
return null; return null;