Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Cache Annotation(Issue in Cache - Expire attribute)
Cache Annotation [message #1076696] Wed, 31 July 2013 14:56 Go to next message
P Soma is currently offline P Soma
Messages: 9
Registered: May 2013
Junior Member
I have configured @Cache annotation in the entity class level (Refer attachment) as below and set the expire time to 7 minutes.

@Cache(type = CacheType.FULL, isolation = CacheIsolationType.SHARED, size = 64000, expiry = 420000)

First time when I tried to load data by invoking find method, the data has retrieved from shared cache. But when I attempt to retrieve the data after 5 minutes, the data has loaded from database instead of loading from shared cache. I am expecting the data to be loaded from shared cache because I set to expire the instance after 7 minutes.

Please someone let me know what could be wrong and how to resolve.
  • Attachment: cache.zip
    (Size: 9.30KB, Downloaded 22 times)
Re: Cache Annotation [message #1082441 is a reply to message #1076696] Thu, 08 August 2013 11:11 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The expiry is from when the data was originally put into the cache, not the last find() operation.
When do you put the data into the cache? Are you sure you are timing things correctly? Try 1 minutes, etc.


James : Wiki : Book : Blog : Twitter
Previous Topic:JPA 2.1 @Converter bug?
Next Topic:Example AttributeTransformer for @Transformation
Goto Forum:
  


Current Time: Tue Jul 29 04:42:07 EDT 2014

Powered by FUDForum. Page generated in 0.01822 seconds