Thank you very much Shawn for sharing your experience and code on this, we'll 
certainly use it.

Guys, do you think dbcp-1.4.1 is going to come out soon?


Rene Romero Benavides
Administrador de Bases de Datos para Command Center
+52(55) 11020460 Ext. 6432 |  Office

+52 1 5545664012 |  Mobile

www.omnitracs.com/mx<http://www.omnitracs.com/mx>

Register today!  www.omnitracs.com/outlook<http://www.omnitracs.com/outlook>

<https://outlook.office.com/owa/service.svc/s/GetFileAttachment?id=AAMkAGM2NWIyZGFmLWZhMTYtNDUzNC04YzQ5LWEwOTA1Zjk4MTY3ZgBGAAAAAABp9rw%2F5DvqQ5VNu%2FP5FANvBwCC6JFKXcS6RJy5Q76IhGGqAAAAAAEMAACC6JFKXcS6RJy5Q76IhGGqAACGtmA4AAABEgAQANT3RQAH0VJIrveZGngUUTQ%3D&X-OWA-CANARY=zgTt0gEIPEaHc-Q35K2xD7ADDSE3yNIYLGPJUeTkGumastS1fdcpigPbw4ASyo9SSzPAsJtdi6o>
________________________________
From: Shawn Heisey <[email protected]>
Sent: Tuesday, January 24, 2017 6:29:34 PM
To: Commons Users List
Subject: Re: [EXTERNAL]Re: DBCP issuing more sessions than maxActive sessions 
in Oracle

On 1/24/2017 3:55 PM, Romero, René wrote:
> We're running  commons-dbcp-1.4 and commons-pool-1.6. To me, it sounds like 
> we're being impacted by this bug:
>
> https://issues.apache.org/jira/browse/DBCP-379
>
> [DBCP-379] number of connections created has crossed more 
> ...<https://issues.apache.org/jira/browse/DBCP-379>
> issues.apache.org
> I found that when the minIdle is configured then during loads, common pool 
> creates more number of connections it will be greater than maxActive.
>
> Is it transparent application-wise to jump from these versions to the 
> latests? Or what upgrading path do you suggest we take?

I don't know anything about that bug or whether that is what you are
encountering, but I can discuss upgrading.

You seem to be on the latest 1.x versions.  Upgrading to the 2.x
versions will require code changes, because the package names have
changed.  A few other things have changed as well.

When I did the upgrade, I found it to be pretty easy to make the
conversion.  Changing the imports was a big part of the job, which my
IDE (eclipse) basically did for me.  A few changes were also required
when building the datasource objects.

Here's a slightly redacted patch that shows the code changes I made when
I upgraded POOL and DBCP from 1.x to 2.x:

https://www.dropbox.com/s/de1hpa767i8tg5s/dbcp2-upgrade.patch?dl=0

This upgrade was done nearly two years ago, but I think I remember
enough about it that I may be able to answer questions on the patch.

The code went through a whole bunch of changes after the upgrade.  I
changed "replica" to "main" throughout the class.  The "replica database
server" section that you can see in the patch now looks like the following:

  /*
   * Create a datasource (connection pool) for the main database server.
   */
  ConnectionFactory cfMain = new DriverManagerConnectionFactory(mainUrl,
dbUser, dbPass);
  PoolableConnectionFactory pcfMain = new
PoolableConnectionFactory(cfMain, null);
  pcfMain.setValidationQuery(validationQuery);
  pcfMain.setValidationQueryTimeout(Const.FIVE_SECONDS / 1000);
  opMain = new GenericObjectPool<>(pcfMain);
  opMain.setMaxWaitMillis(Const.THIRTY_SECONDS);
  opMain.setMaxIdle(numShards);
  opMain.setMaxTotal(numShards * 5);
  opMain.setNumTestsPerEvictionRun(numShards * 5);
  opMain.setTimeBetweenEvictionRunsMillis(Const.ONE_MINUTE);
  opMain.setMinEvictableIdleTimeMillis(Const.ONE_MINUTE * 5);
  pcfMain.setPool(opMain);
  dsMain = new PoolingDataSource<>(opMain);

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to