[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3522) Null value cannot be cache using hibernate
Lao Shing Kit (JIRA)
noreply at atlassian.com
Wed Mar 4 02:34:38 EST 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=32552#action_32552 ]
Lao Shing Kit commented on HHH-3522:
------------------------------------
Both hibernate and Ehcache do not cache null value.
The resolution is that I implement my own cache mechanism for null value which I think it is not appropriate for each application to do that. So I do not attach any code here.
> 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