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

Disable JMX for Statement Pool

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.1
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: