Author: manik.surtani(a)jboss.com
Date: 2008-01-14 05:42:35 -0500 (Mon, 14 Jan 2008)
New Revision: 5120
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFactory.java
Log:
Moved logging from TMF to CacheImpl
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-11 21:27:24 UTC (rev
5119)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-14 10:42:35 UTC (rev
5120)
@@ -586,6 +586,10 @@
log.info("Interceptor chain is:\n" +
CachePrinter.printInterceptorChain(interceptorChain));
}
+ if (configuration.getNodeLockingScheme() ==
Configuration.NodeLockingScheme.OPTIMISTIC && transactionManager == null)
+ {
+ log.fatal("No transaction manager lookup class has been defined.
Transactions cannot be used and thus OPTIMISTIC locking cannot be used! Expect
errors!!");
+ }
correctRootNodeType();
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFactory.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFactory.java 2008-01-11
21:27:24 UTC (rev 5119)
+++
core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFactory.java 2008-01-14
10:42:35 UTC (rev 5120)
@@ -1,6 +1,5 @@
package org.jboss.cache.factories;
-import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.factories.annotations.DefaultFactoryFor;
import org.jboss.cache.transaction.TransactionManagerLookup;
@@ -16,8 +15,6 @@
@DefaultFactoryFor(classes = {TransactionManager.class})
public class TransactionManagerFactory extends ComponentFactory
{
- boolean messageLogged = false;
-
@Override
@SuppressWarnings("unchecked")
protected <T> T construct(String componentName, Class<T> componentType)
@@ -49,21 +46,6 @@
transactionManager = lookup.getTransactionManager();
configuration.getRuntimeConfig().setTransactionManager(transactionManager);
}
- else
- {
- if (!messageLogged)
- {
- messageLogged = true;
- if (configuration.getNodeLockingScheme() ==
Configuration.NodeLockingScheme.OPTIMISTIC)
- {
- log.fatal("No transaction manager lookup class has been
defined. Transactions cannot be used and thus OPTIMISTIC locking cannot be used");
- }
- else
- {
- log.info("No transaction manager lookup class has been defined.
Transactions cannot be used");
- }
- }
- }
}
catch (Exception e)
{
Show replies by date