This commit is contained in:
Strong Liu 2011-06-14 16:57:45 +08:00
parent 85ce03969d
commit a2982ea939
2 changed files with 13 additions and 11 deletions

View File

@ -27,8 +27,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.sql.Connection; import java.sql.Connection;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@ -177,7 +177,7 @@ public final class Environment implements AvailableSettings {
private static final boolean JVM_HAS_TIMESTAMP_BUG; private static final boolean JVM_HAS_TIMESTAMP_BUG;
private static final Properties GLOBAL_PROPERTIES; private static final Properties GLOBAL_PROPERTIES;
private static final HashMap ISOLATION_LEVELS = new HashMap(); private static final Map<Integer,String> ISOLATION_LEVELS;
private static final Map OBSOLETE_PROPERTIES = new HashMap(); private static final Map OBSOLETE_PROPERTIES = new HashMap();
private static final Map RENAMED_PROPERTIES = new HashMap(); private static final Map RENAMED_PROPERTIES = new HashMap();
@ -206,13 +206,13 @@ public final class Environment implements AvailableSettings {
static { static {
LOG.version(Version.getVersionString()); LOG.version(Version.getVersionString());
Map<Integer,String> temp = new HashMap<Integer,String>();
ISOLATION_LEVELS.put( (Connection.TRANSACTION_NONE), "NONE" ); temp.put( Connection.TRANSACTION_NONE, "NONE" );
ISOLATION_LEVELS.put( (Connection.TRANSACTION_READ_UNCOMMITTED), "READ_UNCOMMITTED" ); temp.put( Connection.TRANSACTION_READ_UNCOMMITTED, "READ_UNCOMMITTED" );
ISOLATION_LEVELS.put( (Connection.TRANSACTION_READ_COMMITTED), "READ_COMMITTED" ); temp.put( Connection.TRANSACTION_READ_COMMITTED, "READ_COMMITTED" );
ISOLATION_LEVELS.put( (Connection.TRANSACTION_REPEATABLE_READ), "REPEATABLE_READ" ); temp.put( Connection.TRANSACTION_REPEATABLE_READ, "REPEATABLE_READ" );
ISOLATION_LEVELS.put( (Connection.TRANSACTION_SERIALIZABLE), "SERIALIZABLE" ); temp.put( Connection.TRANSACTION_SERIALIZABLE, "SERIALIZABLE" );
ISOLATION_LEVELS = Collections.unmodifiableMap( temp );
GLOBAL_PROPERTIES = new Properties(); GLOBAL_PROPERTIES = new Properties();
//Set USE_REFLECTION_OPTIMIZER to false to fix HHH-227 //Set USE_REFLECTION_OPTIMIZER to false to fix HHH-227
GLOBAL_PROPERTIES.setProperty( USE_REFLECTION_OPTIMIZER, Boolean.FALSE.toString() ); GLOBAL_PROPERTIES.setProperty( USE_REFLECTION_OPTIMIZER, Boolean.FALSE.toString() );
@ -334,7 +334,7 @@ public final class Environment implements AvailableSettings {
* @return a human-readable name * @return a human-readable name
*/ */
public static String isolationLevelToString(int isolation) { public static String isolationLevelToString(int isolation) {
return (String) ISOLATION_LEVELS.get( isolation ); return ISOLATION_LEVELS.get( isolation );
} }
public static BytecodeProvider buildBytecodeProvider(Properties properties) { public static BytecodeProvider buildBytecodeProvider(Properties properties) {

View File

@ -131,7 +131,9 @@ public abstract class AbstractServiceRegistryImpl implements ServiceRegistryImpl
} }
private <R extends Service> R initializeService(ServiceBinding<R> serviceBinding) { private <R extends Service> R initializeService(ServiceBinding<R> serviceBinding) {
LOG.trace( "Initializing service [role=" + serviceBinding.getServiceRole().getName() + "]" ); if ( LOG.isTraceEnabled() ) {
LOG.trace( "Initializing service [role=" + serviceBinding.getServiceRole().getName() + "]" );
}
// PHASE 1 : create service // PHASE 1 : create service
R service = createService( serviceBinding ); R service = createService( serviceBinding );