cancel
Showing results for 
Search instead for 
Did you mean: 

Cache Always Misses on parentAssoc

jgreen
Champ in-the-making
Champ in-the-making
I have a fairly small box to run a test deploy of Alfresco on and I've been watching the cache hits to see if the cache is getting used.  I've seen a lot of cache misses on the parent<->child associations, and nothing seems to be getting loaded into the cache.


===>  org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs
      Hit Count:                   27699 hits        |         Miss Count:         19315 misses
      Deep Size:                    0.00 MB          |         Current Count:          0 entries
      Percentage used:              0.00 percent     |         Max Count:          10000 entries
      Estimated maximum size:        NaN MB

And I have a lot of these error messages posted (which must be related)


16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7015
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7016
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.ChildAssocImpl#7045
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7016
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7017
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.ChildAssocImpl#7046
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7017
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7018
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.ChildAssocImpl#7047
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7018
16:38:07,531 WARN  [hibernate.cache.ReadWriteCache] An item was expired by the cache while it was locked (increase your cache timeout): org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs#7019

I checked the cache config, for these associations:

 <!–  approx 10MB memory required 
  –>
  <cache name="org.alfresco.repo.domain.hibernate.NodeImpl.parentAssocs" maxElementsInMemory="10000" eternal="true" overflowToDisk="false" />
<!–  approx 250MB memory required
  –>
  <cache name="org.alfresco.repo.domain.hibernate.ChildAssocImpl" maxElementsInMemory="200000" eternal="true" overflowToDisk="false" />

There is almost nothing in ehcache-transactional, so I'll list it here, pretty sure it's not involved.

<ehcache>
  <diskStore path="java.io.tmpdir" />
  <defaultCache maxElementsInMemory="5000" eternal="true" timeToIdleSeconds="0" timeToLiveSeconds="0" overflowToDisk="false" />
  </ehcache>

I'm currently running 1.4 Community on Tomcat/ Win 2003  :cry:.
1 REPLY 1

derek
Star Contributor
Star Contributor
Hi,

This message is a little misleading.  It's actually Hibernate that decided that the cache needed to be completely cleared due to an update statement issued direct to the database.  Later, when the transaction commits, the entity is no longer in the cache and a timeout is blamed.

I've looked at ways to prevent the auto-clearing of cache entities, but can't get it working.  The good news is that the behaviour is correct.  The bad news is that the cache is not being used to its full potential.

I've tried changing the session flush behaviour during the child association update statement.  I tried changing the query flush behaviour as well.  Perhaps I'm missing something on the Hibernate side to disable this behaviour.  After all, we can do an explicit refresh of the entity being updated after the operation.

In the meantime, the message is just cut out of the log.

Regards