Author: bstansberry(a)jboss.com
Date: 2008-06-09 18:27:40 -0400 (Mon, 09 Jun 2008)
New Revision: 14756
Modified:
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/builder/MultiplexingCacheInstanceManager.java
Log:
[HHH-3340] Don't fail if cache TM != discovered TM
Modified:
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/builder/MultiplexingCacheInstanceManager.java
===================================================================
---
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/builder/MultiplexingCacheInstanceManager.java 2008-06-09
16:58:31 UTC (rev 14755)
+++
core/trunk/cache-jbosscache2/src/main/java/org/hibernate/cache/jbc2/builder/MultiplexingCacheInstanceManager.java 2008-06-09
22:27:40 UTC (rev 14756)
@@ -411,10 +411,12 @@
if (cache.getCacheStatus() != CacheStatus.INSTANTIATED) {
// We can't change the TM on a running cache; just check
// if the cache has no TM and we're OK with that
- if (!allowNull || cacheTm != null) {
- throw new CacheException("JBoss Cache is already started "
+ "with a transaction manager ("
- + cacheTm + ") that doesn't match our own (" +
tm + ")");
- }
+ if (!allowNull && cacheTm == null) {
+ throw new CacheException("JBoss Cache is already started with no
transaction manager configured");
+ } else {
+ log.debug("JBoss Cache is already started with a transaction
manager ("
+ + cacheTm + ") that is not equal to our own (" + tm +
")");
+ }
} else {
// Configure the cache to use our TM
cacheConfig.getRuntimeConfig().setTransactionManager(tm);
Show replies by date