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

Brian Stansberry (JIRA) noreply at atlassian.com
Tue Mar 17 10:50:38 EDT 2009


JBC second level cache integration can cache 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.3.x


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