'org.hibernate.cache.ReadWriteCache handleLockExpiry An item was expired by the cache while it was locked' Error Messages
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
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
[31/05/10 15:48:18:168 EST] 00000549 ReadWriteCache net.sf.hibernate.cache.ReadWriteCache handleLockExpiry An item was
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.