[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3245) Missing release from cache in "EntityInsertAction" during rollback.

Alexander Krasnostavksy (JIRA) noreply at atlassian.com
Mon Apr 21 09:40:33 EDT 2008


Missing release from cache in "EntityInsertAction" during rollback.
-------------------------------------------------------------------

                 Key: HHH-3245
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3245
             Project: Hibernate3
          Issue Type: Bug
          Components: caching (L2)
    Affects Versions: 3.2.6
         Environment: Hibernate 3.2.6
Oracle 10.2.0.3.0
            Reporter: Alexander Krasnostavksy


"EntityInsertAction" is missing release from a cache in the same way as it done in "EntityUpdateAction". This causes wrong behavior after rollback when generator class is "assigned" and cache usage is defined.
The cache handling should be like this:

if (persister.hasCache())
{
    final CacheKey ck = new CacheKey( 
                    getId(), 
                    persister.getIdentifierType(), 
                    persister.getRootEntityName(), 
                    getSession().getEntityMode(), 
                    getSession().getFactory() 
                );

    if ( success && isCachePutEnabled( persister, getSession() ) ) {
        boolean put = persister.getCache().afterInsert(ck, cacheEntry, version );

        if ( put && getSession().getFactory().getStatistics().isStatisticsEnabled() ) {
                getSession().getFactory().getStatisticsImplementor()
                        .secondLevelCachePut( getPersister().getCache().getRegionName() );
        }
    }
    else if (cacheEntry!=null) {
        persister.getCache().release(ck, lock );
    }
}


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