dlr 2002/07/08 00:33:44
Modified: src/java/org/apache/torque Torque.java
Log:
o Corrected indentation level of closing brace for the
initDataSourceFactories(Configuration) method.
o Removed invalid comment in getDefaultDB() which indicated that
defaultDBName will always be the same object. A race condition
exists on first initialization of that class attribute which makes
that assurance impossible without synchronization (which should be
avoided on a method which could be called as often as getDefaultDB()).
Revision Changes Path
1.66 +5 -7 jakarta-turbine-torque/src/java/org/apache/torque/Torque.java
Index: Torque.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/Torque.java,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -u -r1.65 -r1.66
--- Torque.java 7 Jul 2002 11:35:34 -0000 1.65
+++ Torque.java 8 Jul 2002 07:33:44 -0000 1.66
@@ -314,7 +314,6 @@
}
}
- //
// As there might be a default database configured
// to map "default" onto an existing datasource, we
// must check, whether there _is_ really an entry for
@@ -330,14 +329,14 @@
//
String defaultDB = getDefaultDB();
- if(dsFactoryMap.get(DEFAULT_NAME) == null
- && !defaultDB.equals(DEFAULT_NAME))
+ if (dsFactoryMap.get(DEFAULT_NAME) == null
+ && !defaultDB.equals(DEFAULT_NAME))
{
category.debug("Adding a dummy entry for "
+ DEFAULT_NAME + ", mapped onto " + defaultDB);
dsFactoryMap.put(DEFAULT_NAME, dsFactoryMap.get(defaultDB));
}
-}
+ }
/**
* configure torque
@@ -935,10 +934,9 @@
{
return DEFAULT_NAME;
}
- // save the property lookup, so that we can be sure it is always the
- // same object.
else if (defaultDBName == null)
{
+ // Determine default database name.
defaultDBName =
configuration.getString(DATABASE_DEFAULT, DEFAULT_NAME);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>