[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3195) session.clear() is not effective when use_query_cache is true

Chris Brown (JIRA) noreply at atlassian.com
Tue Feb 17 08:08:41 EST 2009


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

Chris Brown commented on HHH-3195:
----------------------------------

Further to my comment above, calling afterTransactionCompletion early is dangerous if you are using a read-write cache: if your operation fails, causing the transaction to be rolled back, the modified entities will still be committed to the cache, leaving it in a corrupt state. However, if you are using a non-strict read-write cache (as I am) all that happens is that the cache is invalidated, which doesn't matter so much.

The only non-cache related consequences of calling afterTransactionCompletion that I can find from reading the source are related to the Hibernate search index. If you aren't using Hibernate search, then that won't be an issue.

> session.clear() is not effective when use_query_cache is true
> -------------------------------------------------------------
>
>                 Key: HHH-3195
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3195
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.2.6
>         Environment: 3.2.6.ga, MySQL5
>            Reporter: James Berry
>
> As discussed in detail in http://forum.hibernate.org/viewtopic.php?t=944918, performing many inserts while use_query_cache is enabled will eventually cause an out of memory condition, even if the session is periodically flushed and cleared. That forum thread describes a potential root cause for this problem. Nobody from the Hibernate team has responded regarding the forum thread, even though it's been alive for three years now!
> Note that an answer to "disable the query cache" is not a good solution to the problem, as we need the query cache elsewhere. If it were possible to disable the query cache for a particular session, that would be fine, but I see no way do that.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list