
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
windows 2000, IBM JDK 1.3.1 (Websphere 5)
|
|
|
When I specify the 'cache.capacity' property in oscache.properties, it always takes precedence over the setCacheCapacity on GeneralCacheAdministrator.
Sample:
1) in oscache.properties
cache.capacity = 3
2) run simple code:
GeneralCacheAdministrator cacheAdmin = new GeneralCacheAdministrator();
cacheAdmin.setCacheCapacity(2); // less than in properties
cacheAdmin.putInCache("a1", "a1");
cacheAdmin.putInCache("a2", "a2");
cacheAdmin.putInCache("a3", "a3");
cacheAdmin.putInCache("a4", "a4");
System.out.println(cacheAdmin.getFromCache("a1")); // prints null, OK
System.out.println(cacheAdmin.getFromCache("a2")); // prints a2, BAD!
System.out.println(cacheAdmin.getFromCache("a3")); // prints a3
System.out.println(cacheAdmin.getFromCache("a4")); // prints a4
I would expect that setCacheCapacity not only cut values once, but defines the new maximum capacity to be used all the time.
|
|
Description
|
When I specify the 'cache.capacity' property in oscache.properties, it always takes precedence over the setCacheCapacity on GeneralCacheAdministrator.
Sample:
1) in oscache.properties
cache.capacity = 3
2) run simple code:
GeneralCacheAdministrator cacheAdmin = new GeneralCacheAdministrator();
cacheAdmin.setCacheCapacity(2); // less than in properties
cacheAdmin.putInCache("a1", "a1");
cacheAdmin.putInCache("a2", "a2");
cacheAdmin.putInCache("a3", "a3");
cacheAdmin.putInCache("a4", "a4");
System.out.println(cacheAdmin.getFromCache("a1")); // prints null, OK
System.out.println(cacheAdmin.getFromCache("a2")); // prints a2, BAD!
System.out.println(cacheAdmin.getFromCache("a3")); // prints a3
System.out.println(cacheAdmin.getFromCache("a4")); // prints a4
I would expect that setCacheCapacity not only cut values once, but defines the new maximum capacity to be used all the time. |
Show » |
|