Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-434

Disable JMX for Statement Pool

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:

      commons-dbcp2: 2.0.1
      commons-pool2: 2.3

      Description

      I'm using the PoolableConnectionFactory and don't care about JMX, so I don't set the dataSourceJmxName, but I want to use a pool for my PreparedStatements. The makeObject() method initializes this pool automatically (lines 224-243) but seems to forget to disable JMX completely if I don't want it, i.e. GenericKeyedObjectPoolConfig.setJmxEnabled(...) is never called and always has the default value (=true). Therefore the JMX registration happens, which can cause a problem for me because of security constraints.

      Because of the way the makeObject() method is written, I have no influence on this part, so my quick solution was to disable the poolStatement option for the PoolableConnectionFactory and provide a custom ConnectionFactory object instead that basically does the same thing with the statement pool and also disables the JMX option.

        Attachments

        1. DBCP-434.patch
          0.8 kB
          Phil Steitz

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thieringer Thomas Thieringer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: