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

Key: CACHE-223
Type: Bug Bug
Status: Closed Closed
Resolution: Not A Problem
Priority: Major Major
Assignee: Lars Torunski
Reporter: Simon Bouchard
Votes: 0
Watchers: 0
Operations

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

completeUpdate never being called after startUpdate() has been called, OSCache hangs for that key

Created: 12/Dec/05 10:58 AM   Updated: 12/Dec/05 11:17 AM
Component/s: Base Classes
Affects Version/s: None
Fix Version/s: 2.2 final

Flags: Important


 Description  « Hide
In the method Cache.getFromCache(String, int, String), updateState.startUpdate() gets called.

updateState.completeUpdate() only gets called in the methode Cache.putInCache(...).

Therefore, If you try to read from the cache, miss, and then you don't put anything in the cache for that key, the next time getFromCache(...) gets called for that same key, the thread will wait forever for the update status to be changed to complete.

 All   Comments   Change History      Sort Order:
Simon Bouchard - [12/Dec/05 10:59 AM ]
Forgot to mention, this is reproduceable in 2.2, and probably 2.1

Lars Torunski - [12/Dec/05 11:17 AM ]
It's not a bug, it works as it is designed. Taken from JavaDoc:

NeedsRefreshException - Thrown when the object either doesn't exist, or exists but is stale. When this exception occurs, the CacheEntry corresponding to the supplied key will be locked and other threads requesting this entry will potentially be blocked until the caller repopulates the cache. If the caller choses not to repopulate the cache, they must instead call cancelUpdate(String).

Read http://wiki.opensymphony.com/display/CACHE/API+Usage how to access the cache without blocking.