[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5490) dirty data be inserted into 2L cache

Steve Ebersole (JIRA) noreply at atlassian.com
Thu Sep 16 16:25:22 EDT 2010


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

Steve Ebersole resolved HHH-5490.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 3.5.x
                   3.6.x

> dirty data be inserted into 2L cache 
> -------------------------------------
>
>                 Key: HHH-5490
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5490
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: caching (L2)
>    Affects Versions: 3.5.5, 3.6.0.Beta3
>            Reporter: Strong Liu
>            Assignee: Steve Ebersole
>             Fix For: 3.6.x, 3.5.x
>
>         Attachments: Item.java, ItemTest.java
>
>          Time Spent: 4.35h
>  Remaining Estimate: 0h
>
> {code}
> 	public void testInsertWithRefresh() {
> 		getSessions().getCache().evictEntityRegions();
> 		getSessions().getStatistics().clear();
> 		
> 		Session s = openSession();
> 		s.beginTransaction();
> 		Item item = new Item();
> 		item.setName("stliu");
> 		s.save(item);
> 		s.flush();
> 		s.refresh(item);
> 		s.getTransaction().rollback();
> 		s.close();
> 		
> 		Map cacheMap = getSessions().getStatistics()
> 				.getSecondLevelCacheStatistics("item").getEntries();
> 		assertEquals(0, cacheMap.size());
> 		
> 		s = openSession();
> 		s.beginTransaction();
> 		item = (Item)s.get(Item.class, item.getId());
> 		s.getTransaction().commit();
> 		s.close();
> 		
> 		assertNull("it should be null", item);
> 	}
> {code}
> see above test case, since the insertion is rollbacked, so, there is no that row in the DB, but you can see the null assertion will fail due to the dirty data be inserted into the 2l cache after refresh operation.

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