tfischer 2005/03/12 12:08:34
Modified: src/java/org/apache/torque TorqueInstance.java
Log:
Check whether Torque is initialized before retrieving a connection
Torque does not throw an obvious error message if it is not initialized and
the db is accessed.
This check should take care of that
See also issue TRQS288 in scarab
Revision Changes Path
1.10 +8 -3 db-torque/src/java/org/apache/torque/TorqueInstance.java
Index: TorqueInstance.java
===================================================================
RCS file: /home/cvs/db-torque/src/java/org/apache/torque/TorqueInstance.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TorqueInstance.java 31 Jan 2005 19:43:58 -0000 1.9
+++ TorqueInstance.java 12 Mar 2005 20:08:34 -0000 1.10
@@ -51,7 +51,7 @@
* this class.
*
* @author <a href="mailto:[email protected]">Daniel Rall</a>
- * @author <a href="mailto:[EMAIL PROTECTED]">Magn�s ��r Torfason</a>
+ * @author <a href="mailto:[EMAIL PROTECTED]">Magn�s ��r Torfason</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
@@ -718,7 +718,12 @@
protected DataSourceFactory getDataSourceFactory(String name)
throws TorqueException
{
- DataSourceFactory dsf = null;
+ if (!Torque.isInit())
+ {
+ throw new TorqueException("Torque is not initialized.");
+ }
+
+ DataSourceFactory dsf = null;
try
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]