[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5030) BaseRegionAdapter shouldn't rely on optional Cache#toMap method

Adrian Hummel (JIRA) noreply at atlassian.com
Tue Mar 23 11:54:31 EDT 2010


BaseRegionAdapter shouldn't rely on optional Cache#toMap method
---------------------------------------------------------------

                 Key: HHH-5030
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5030
             Project: Hibernate Core
          Issue Type: Bug
          Components: caching (L2)
    Affects Versions: 3.5.0-CR-2
         Environment: hibernate-oscache 3.5.0.Beta-1
            Reporter: Adrian Hummel
         Attachments: bugreport.zip

Get an {{UnsupportedOperationException}} when checking the L2 cache if it contains an entity:

{code}
emf.getCache().contains(MyEntity.class, pk);
{code}

Result:

{code}
java.lang.UnsupportedOperationException
	at org.hibernate.cache.OSCache.toMap(OSCache.java:126)
	at org.hibernate.cache.impl.bridge.BaseRegionAdapter.contains(BaseRegionAdapter.java:62)
	at org.hibernate.impl.SessionFactoryImpl$CacheImpl.containsEntity(SessionFactoryImpl.java:967)
	at org.hibernate.impl.SessionFactoryImpl$CacheImpl.containsEntity(SessionFactoryImpl.java:962)
	at org.hibernate.ejb.EntityManagerFactoryImpl$JPACache.contains(EntityManagerFactoryImpl.java:164)
	...
{code}

The {{Cache#toMap}} method is optional (according to Javadoc), thus, {{BaseRegionAdapter}} shouldn't rely on this method.


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