unless DBCP changed of course.

I would add
​the following property to your <Resource> element​


factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"

http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html



On Tue, Feb 24, 2015 at 3:47 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Red,
>
> On 2/24/15 4:20 PM, Red wrote:
> > OS: Ubuntu 14.04.2 LTS Oracle: 12.1.0.1.0 or  11.2.0.3.0 Tomcat:
> > 7.0.52-1ubuntu0.1 odjbc: Ojdbc6 or Ojdbc7 (placed in
> > /var/lib/tomcat7/lib) java version "1.8.0_31" of "1.7.0_65"
> >
> > Context.xml: <Resource  name="*********1" auth="Container"
> > type="javax.sql.DataSource"
> > driverClassName="oracle.jdbc.OracleDriver"
> > url="jdbc:oracle:thin:@//*********:1521/********" minIdle="1"
> > username="*******" password="*******" maxActive="10" maxIdle="10"
> > maxWait="-1"  /> <Resource  name="******2" auth="Container"
> > type="javax.sql.DataSource"
> > driverClassName="oracle.jdbc.OracleDriver"
> > url="jdbc:oracle:thin:@//*******:1521/**********"
> > username="*******" password="**********" maxActive="20"
> > maxIdle="10" maxWait="-1"   />
> >
> > Immediately after tomcat startup, number of connection goes up
> > until it reaches below:
> >
> > SQL> select machine, username, count (1) from v$session group by
> > machine, username;
> >
> > MACHINE   USERNAME              COUNT(1) ---------
> > --------------------- ---------- tc        ******1
> > 40 tc        ******2               60
> >
> > Then, after a while connection count drops to:
> >
> > MACHINE   USERNAME              COUNT(1) ---------
> > --------------------- ---------- tc        ******1               6
> > tc        ******2               60
> >
> >
> >
> > I have commented all other pools, most fail due to lack of
> > resources on database side (hundreeds of connections).  Connection
> > are opened if pool is defined in context.xml, even if actually not
> > used anywhere.
> >
> > Catalina.out gives me nothing for two pools, bunch of errors with 3
> > or more, but those seem to be due to exhaustion of databases
> > availability.
> >
> > Looked up oracle support, nothing of use there.  All of this works
> > fine with tomcat6, java6, oracle 11g or 12c
>
> So which one of these makes a difference? Tomcat's connection pool
> didn't change dramatically between Tomcat 6 and 7. The Java version
> likely has nothing to do with it, and the Oracle version also likely
> has nothing to do with it.
>
> So what's the problem?
>
> Has your application's user behavior changed in any way? Say, an
> increase in traffic?
>
> What you describe sounds an awful lot like poor resource management in
> the application itself.
>
> 1. Are you sure every part of your application is using your JDBC pools?
>
> 2. Read this:
>
> http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling-pooled-jdbc-connections/
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: GPGTools - http://gpgtools.org
>
> iQIcBAEBCAAGBQJU7P9wAAoJEBzwKT+lPKRYX/YP/ijgvvieYaNlgaM7cODgPPzm
> 4GdEyJfXW+xQA5HBOBQemz5CX8YWrSgr9PrlSumf/uU6mx57G1yhmDdmwv1N5jnJ
> ct9hBU97aw/6t7FiGF+JPyEjbhETBRIZB5NoOKPiP8CNJeTMd8a9z1Qe6aU1oXMM
> yPtsvzg7J5aziKzpdm9xrb0lXtdQe9ga5YfikPShS6Tup1iJzcCImi27RQ6nuUFY
> zC8wHVmz0PU8UcbLpFDQGTTUsq6JtQvR/aGpDcHYfq8dNqavnP/QECcx6ZQlixy6
> HX30Oj4s/D/I5ez8PXAo2PiSF4ZZ86j0UQt9ntqcDeE7w7ldIfLQ2NCj5jANS6SL
> coG3n0tszmVSfCQ3fCXsTphbry0NZSJjNwmkZ4ezXj+3KpD5oATbaTLVL9ZeH9s4
> d3HiheNcF//pdeGDZ5Zy09vAO94V9CD+fr2TbbovluHzgpuOu7vYqAwg6IzuMQfs
> QWwmiC+Rccp6PnWltSJ7ClIKTh9mDHI7cejdFmQJe4J0kN7HZHggkk7ZlJD5/p6h
> sEVxmBZ0JMm0GJzoqOurtHKrviqvbfOJhXd5w6Jmv9Dyj7yK/izhXkACmOp7Rz9K
> 9/T1OQsyWBtbWho8/xdisEUvsuY9w3lIf2uIeQmikIpICQ4NYddxz5I3/zpd8CSo
> KApJwDf0qsXvXduOrANP
> =F0TE
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to