Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.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.