History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CACHE-158
Type: Improvement Improvement
Status: In Progress In Progress
Priority: Minor Minor
Assignee: Andres March
Reporter: Dariusz Wojtas
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
OSCache

cache.capacity and GeneralCacheAdministrator.setCacheCapacity problem

Created: 30/Mar/05 07:54 AM   Updated: 08/Sep/05 10:29 PM
Component/s: Base Classes
Affects Version/s: 2.1
Fix Version/s: 3.0

Environment: windows 2000, IBM JDK 1.3.1 (Websphere 5)


 Description  « Hide
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.

 All   Comments   Change History      Sort Order:
Andres March - [04/Apr/05 11:48 PM ]
Sorry, this is how it works for now but we should improve this.