[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4550) Document that update-timestamps cache region should not be configured for expiry.

Adrien (JIRA) noreply at atlassian.com
Thu Jan 19 06:23:12 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45170#comment-45170 ] 

Adrien commented on HHH-4550:
-----------------------------

http://www.ehcache.org/documentation/user-guide/hibernate

With the new global pool of object (specifing the total memory size instead of the size of each cache size) in ehCache 2.5, specifing that the cache should not expired is not enough. The cache may be cleared if the other caches are used. It is important to pinned the cache, to ensure it won't be clear. We could be confident that, even with the cache spinned, it won't explode, since the number of hibernate "space" is not infinite.

<ehcache maxBytesLocalHeap="500M">
	<cache name="org.hibernate.cache.UpdateTimestampsCache" eternal="true" overflowToDisk="false">
		<pinning store="inCache" />
	</cache>
</ehcache>

> Document that update-timestamps cache region should not be configured for expiry.
> ---------------------------------------------------------------------------------
>
>                 Key: HHH-4550
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4550
>             Project: Hibernate ORM
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 3.3.2
>         Environment: 3.3.2 GA
>            Reporter: Guenther Demetz
>            Assignee: Steve Ebersole
>            Priority: Trivial
>             Fix For: 3.3.x, 3.5.0-Beta-3
>
>         Attachments: TestCaseQuryCache.jar
>
>
> When using hibernate's query cache (hibernate.cache.use_query_cache),
> then it's of fundamental importance to configure the Update Timestamps cache region in
> a way that his entries survive longer than the cached result sets in the Query cache region.
> Otherwise queries could return wrong (obsolete) result sets (See attached testcase).
> This is because the current UpdateTimestampsCache#isUpToDate implementation considers a result-set also as up-to-date,
> if there are no update-timestamps cached for the interested spaces (tables) at all.
> It if therefore important to notice that:
> 1- The Update-Timestamps-Cache-Region elements max-size should be configured higher than the number of tables you have 
>    on the db-schema, in manner that he can remember/hold the last update-timestamp for each table.
> 2- If you use any other eviction policy in the Update-Timestamps-Cache-Region, then you must assure 
>    that cached result sets in the Query-cache-region are evicted before relevant update-timestamps are going to be evicted.
> This fact should be clearly documented somewhere.
> Thanks
> G.D.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list