johng 2002/12/20 10:59:51
Modified: java/src/org/apache/xalan/lib/sql DefaultConnectionPool.java
Log:
Added in missing code for disable pool
Code provided by [EMAIL PROTECTED]
Revision Changes Path
1.13 +16 -11
xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java
Index: DefaultConnectionPool.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/lib/sql/DefaultConnectionPool.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DefaultConnectionPool.java 29 Oct 2002 16:17:35 -0000 1.12
+++ DefaultConnectionPool.java 20 Dec 2002 18:59:51 -0000 1.13
@@ -479,17 +479,17 @@
{
// We need to implement the context classloader
Class cls = null;
- try
+ try
{
Method m = Thread.class.getMethod("getContextClassLoader", null);
ClassLoader classLoader = (ClassLoader)
m.invoke(Thread.currentThread(), null);
cls = classLoader.loadClass(m_driver);
- }
- catch (Exception e)
+ }
+ catch (Exception e)
{
- cls = Class.forName(m_driver);
+ cls = Class.forName(m_driver);
}
-
+
if (cls == null)
cls = Class.forName(m_driver);
@@ -606,15 +606,20 @@
* The Pool can be Enabled and Disabled. Disabling the pool
* closes all the outstanding Unused connections and any new
* connections will be closed upon release.
- * @param flag Control the Connection Pool. If it is enabled then
Connections will actuall be held
- * around. If disabled then all unused connections will be instantly
closed and as
- * connections are released they are closed and removed from the pool.
+ *
+ * @param flag Control the Connection Pool.
+ * If it is enabled then Connections will actuall be held
+ * around. If disabled then all unused connections will be instantly
+ * closed and as connections are released they are closed and removed
+ * from the pool.
+ *
* @return
*/
- public void setPoolEnabled( final boolean flag )
+ public void setPoolEnabled( boolean flag )
{
-
+ m_IsActive = flag;
+ if ( ! flag )
+ freeUnused();
}
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]