[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3522) Null value cannot be cache using hibernate

Lao Shing Kit (JIRA) noreply at atlassian.com
Wed Jan 7 21:08:38 EST 2009


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

Lao Shing Kit commented on HHH-3522:
------------------------------------

Would you re-open this issue? as I cannot get solution and there is only queries only.
Please notice that even the 1st level cache does not cache the null values. That means if I get by the same Id twice, the same sql will be triggered to db twice by hibernate. 1st level cache should be done by hibernate and is not provider specific. So, I think this is hibernate problem.

For the question about whether this problem is EhCache specific for 2nd level cahce, I have not tried other cache provider. Actually, I have raised the same question to both Ehcache and Hibernate but no response from both party. Would it be possible that Hibernate Team works together with Ehcache team for this problem, as I am following the documentation from Hibernate to enable the 2nd level cache? 

> Null value cannot be cache using hibernate  
> --------------------------------------------
>
>                 Key: HHH-3522
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3522
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: caching (L2)
>         Environment: Hibernate 3.3.1, Ehcache 1.5, Java1.5
>            Reporter: Lao Shing Kit
>   Original Estimate: 1 day
>  Remaining Estimate: 1 day
>
> I'm using Hibernate with 2nd level cache using Ehcache. We found that if the result returned using session.get() (searching by primary key) is NULL, the value will not be cached in 1st level and 2nd level cache and SQL will be fired to database. There is no problem if the value retuurned is not null for the same entity. I have debug using the hibernate and ehcache source and I'm sure that the cache is enabled and called properly. Actually the null value is expected to be cached also. I have browser all hibernate and ehcache documentation and forum and no related config is available. So, is it a bug?
> Thanks all for your help!

-- 
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