[HHH-3340] Don't fail if cache TM != discovered TM

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14756 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Brian Stansberry 2008-06-09 22:27:40 +00:00
parent ae0779becd
commit eca1c43de6
1 changed files with 6 additions and 4 deletions

View File

@ -411,10 +411,12 @@ public class MultiplexingCacheInstanceManager implements CacheInstanceManager {
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);