commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r1594068 - in /commons/proper/dbcp/trunk/src: changes/changes.xml main/java/org/apache/commons/dbcp2/PoolableConnection.java
Date Mon, 12 May 2014 19:32:44 GMT
Author: psteitz
Date: Mon May 12 19:32:44 2014
New Revision: 1594068

URL: http://svn.apache.org/r1594068
Log:
Enable PoolableConnection class to load without JMX. JIRA: DBCP-418

Modified:
    commons/proper/dbcp/trunk/src/changes/changes.xml
    commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java

Modified: commons/proper/dbcp/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/changes/changes.xml?rev=1594068&r1=1594067&r2=1594068&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/changes/changes.xml (original)
+++ commons/proper/dbcp/trunk/src/changes/changes.xml Mon May 12 19:32:44 2014
@@ -76,6 +76,9 @@ The <action> type attribute can be add,u
       <action issue="DBCP-417" dev="psteitz" type="fix">
         Fixed connection leak when managed connections are closed during transactions.
       </action>
+      <action issue="DBCP-418" dev="psteitz" type="fix">
+        Enable PoolableConnection class to load without JMX.
+      </action>
     </release>
     <release version="2.0" date="3 March 2014" description=
 "This release includes new features as well as bug fixes and enhancements.

Modified: commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java?rev=1594068&r1=1594067&r2=1594068&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
Mon May 12 19:32:44 2014
@@ -45,7 +45,15 @@ import org.apache.commons.pool2.ObjectPo
 public class PoolableConnection extends DelegatingConnection<Connection>
         implements PoolableConnectionMXBean {
 
-    private static MBeanServer MBEAN_SERVER = ManagementFactory.getPlatformMBeanServer();
+    private static MBeanServer MBEAN_SERVER = null; 
+
+    static {
+        try {
+            MBEAN_SERVER = ManagementFactory.getPlatformMBeanServer();
+        } catch (Exception ex) {
+            // ignore - JMX not available
+        }
+    }
 
     /** The pool to which I should return. */
     private ObjectPool<PoolableConnection> _pool = null;



Mime
View raw message