[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-3817) JBC second level cache integration can cache stale collection data

Brian Stansberry (JIRA) noreply at atlassian.com
Wed Feb 24 14:13:47 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3817?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Stansberry closed HHH-3817.
---------------------------------

    Resolution: Fixed

> JBC second level cache integration can cache stale collection data
> ------------------------------------------------------------------
>
>                 Key: HHH-3817
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3817
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: caching (L2)
>            Reporter: Brian Stansberry
>            Assignee: Brian Stansberry
>             Fix For: 3.5.0-CR-2
>
>
> Scenario with two transactions dealing with a single collection:
> tx1 reads collection, cache miss
> tx1 goes to database to read collection
> tx2 reads collection, cache miss
> tx2 goes to database to read collection
> tx2 does JBC putForExternalRead to store empty collection
> tx2 updates collection
> tx2 removes collection from JBC (since any collection update triggers a org.hibernate.cache.Cache.evict which is implemented as a JBC removeNode)
> tx1 does JBC putForExternalRead to store empty collection -- STALE DATA
> With entities, if the db is using REPEATABLE_READ this won't be a problem, as the DB won't allow the tx2 update until tx1 commits.  With a collection there is nothing to lock on. It would be a problem for entities with READ_COMMITTED as well.

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