# 'org.hibernate.cache.ReadWriteCache handleLockExpiry An item was expired by the cache while it was locked' Error Messages

#### Still need help?

The Atlassian Community is here for you.

## Symptoms

[31/05/10 15:48:18:160 EST] 00000549 ReadWriteCache net.sf.hibernate.cache.ReadWriteCache handleLockExpiry An item was
expired by the cache while it was locked (increase your cache timeout): 75694677
expired by the cache while it was locked (increase your cache timeout): 75694676


## Cause

Confluence uses Ehcache to control its caching system. This library implements Soft locks by replacing a value with a special type that marks the element as locked, thus indicating to other threads to treat it differently to a normal element. An explanation from Ehcache documentation:

[The Soft Locks mechanism] is used in the Hibernate Read/Write strategy to force fall-through to the database during the two-phase commit - since we don't know exactly what should be returned by the cache while the commit is in process (but the db does).

If a soft-locked Element is evicted by the cache during the 2 phase commit, then once the 2 phase commit completes the cache will fail to update (since the soft-locked Element was evicted) and the cache entry will be reloaded from the database on the next read of that object. This is obviously non-fatal (we're a cache failure here so it should not be a problem).

The only problem it really causes would I imagine be a small rise in db load.

So, in summary the Hibernate messages are not problematic.

## Resolution

You can use the deterministic evictor to avoid this problem.

Specify the java -Dnet.sf.ehcache.use.classic.lru=true system property to turn on classic LRU which contains a deterministic evictor. See Configuring System Properties for instructions.