[hibernate-commits] Hibernate SVN: r14350 - in core/trunk/cache-jbosscache2/src: test/java/org/hibernate/test/cache/jbc2/query and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sat Feb 23 18:47:41 EST 2008


Author: bstansberry at jboss.com
Date: 2008-02-23 18:47:41 -0500 (Sat, 23 Feb 2008)
New Revision: 14350

Modified:
   core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java
   core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/query/QueryRegionImplTestCase.java
Log:
Ensure that queries are segregated from entities/collections if they use the same region name

Modified: core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java
===================================================================
--- core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java	2008-02-23 00:15:59 UTC (rev 14349)
+++ core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/query/QueryResultsRegionImpl.java	2008-02-23 23:47:41 UTC (rev 14350)
@@ -43,8 +43,8 @@
 public class QueryResultsRegionImpl extends TransactionalDataRegionAdapter implements QueryResultsRegion {
 
     public static final String QUERY_CACHE_LOCAL_ONLY_PROP = "hibernate.cache.region.jbc2.query.localonly";
+    public static final String TYPE = "QUERY";
     
-    
     /**
      * Whether we should set an option to disable propagation of changes around
      * cluster.
@@ -134,7 +134,7 @@
 
     @Override
     protected Fqn<String> createRegionFqn(String regionName, String regionPrefix) {
-        return Fqn.fromString(escapeRegionName(regionName, regionPrefix));
+        return getTypeLastRegionFqn(regionName, regionPrefix, TYPE);
     }
 
 }

Modified: core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/query/QueryRegionImplTestCase.java
===================================================================
--- core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/query/QueryRegionImplTestCase.java	2008-02-23 00:15:59 UTC (rev 14349)
+++ core/trunk/cache-jbosscache2/src/test/java/org/hibernate/test/cache/jbc2/query/QueryRegionImplTestCase.java	2008-02-23 23:47:41 UTC (rev 14350)
@@ -36,6 +36,7 @@
 import org.hibernate.cache.jbc2.BasicRegionAdapter;
 import org.hibernate.cache.jbc2.CacheInstanceManager;
 import org.hibernate.cache.jbc2.JBossCacheRegionFactory;
+import org.hibernate.cache.jbc2.query.QueryResultsRegionImpl;
 import org.hibernate.cfg.Configuration;
 import org.hibernate.test.cache.jbc2.AbstractGeneralDataRegionTestCase;
 import org.hibernate.test.util.CacheTestUtil;
@@ -83,7 +84,7 @@
 
     @Override
     protected Fqn getRegionFqn(String regionName, String regionPrefix) {
-        return Fqn.fromString(BasicRegionAdapter.escapeRegionName(regionName, regionPrefix));
+        return BasicRegionAdapter.getTypeLastRegionFqn(regionName, regionPrefix, QueryResultsRegionImpl.TYPE);
     }
 
     public void testPutDoesNotBlockGetOptimistic() throws Exception {




More information about the hibernate-commits mailing list