db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r372597 - in /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker: accesslayer/ConnectionFactoryDBCPImpl.java core/PersistenceBrokerFactoryBaseImpl.java locking/LockHelper.java util/pooling/PoolConfiguration.java
Date Thu, 26 Jan 2006 19:51:27 GMT
Author: tomdz
Date: Thu Jan 26 11:51:21 2006
New Revision: 372597

URL: http://svn.apache.org/viewcvs?rev=372597&view=rev
Log:
Added additional cleanup calls
Removed unnecessary StringUtils usages

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryBaseImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockHelper.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java?rev=372597&r1=372596&r2=372597&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryDBCPImpl.java
Thu Jan 26 11:51:21 2006
@@ -120,6 +120,11 @@
                     try
                     {
                         op = (ObjectPool) iterator.next();
+                        if (op instanceof GenericObjectPool)
+                        {
+                            // deactivates the idle evictor thread
+                            ((GenericObjectPool)op).setTimeBetweenEvictionRunsMillis(-1);
+                        }
                         op.close();
                     }
                     catch (Exception e)

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryBaseImpl.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryBaseImpl.java?rev=372597&r1=372596&r2=372597&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryBaseImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/core/PersistenceBrokerFactoryBaseImpl.java
Thu Jan 26 11:51:21 2006
@@ -15,6 +15,8 @@
  * limitations under the License.
  */
 
+import java.beans.Introspector;
+
 import org.apache.ojb.broker.PBFactoryException;
 import org.apache.ojb.broker.PBKey;
 import org.apache.ojb.broker.PersistenceBroker;
@@ -191,9 +193,12 @@
     {
         try
         {
+            ClassHelper.setClassLoader(null);
             ConnectionFactoryFactory.getInstance().createConnectionFactory().releaseAllResources();
             PersistenceBrokerThreadMapping.shutdown();
             MetadataManager.getInstance().shutdown();
+            // the bean introspector caches beaninfo instances which prevents the classloader
from being GC'd
+            Introspector.flushCaches();
         }
         catch(RuntimeException e)
         {

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockHelper.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockHelper.java?rev=372597&r1=372596&r2=372597&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockHelper.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/locking/LockHelper.java
Thu Jan 26 11:51:21 2006
@@ -16,7 +16,6 @@
  */
 
 import org.apache.ojb.broker.util.logging.LoggerFactory;
-import org.apache.commons.lang.StringUtils;
 
 /**
  * @author <a href="mailto:arminw@apache.org">Armin Waibel</a>
@@ -35,7 +34,7 @@
      */
     public static int getIsolationLevelFor(String isoLevel)
     {
-        if(isoLevel == null || StringUtils.isEmpty(isoLevel))
+        if ((isoLevel == null) || (isoLevel.length() == 0))
         {
             LoggerFactory.getDefaultLogger().debug(
                     "[LockHelper] Specified isolation level string is 'null', using the default
isolation level");

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java
URL: http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java?rev=372597&r1=372596&r2=372597&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/pooling/PoolConfiguration.java
Thu Jan 26 11:51:21 2006
@@ -19,10 +19,9 @@
 import java.util.Properties;
 
 import org.apache.commons.dbcp.AbandonedConfig;
+import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.pool.impl.GenericKeyedObjectPool;
 import org.apache.commons.pool.impl.GenericObjectPool;
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.lang.BooleanUtils;
 import org.apache.ojb.broker.metadata.AttributeContainer;
 
 /**
@@ -201,7 +200,7 @@
     public String getValidationQuery()
     {
         String result = getProperty(VALIDATION_QUERY);
-        return StringUtils.isEmpty(result) ? null : result;
+        return (result == null) || (result.length() == 0) ? null : result;
     }
 
     public void setValidationQuery(String validationQuery)



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message