You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jerry Malcolm <te...@malcolms.com> on 2015/02/10 18:22:48 UTC

Tomcat 8 SQL Connection Problems

Has something changed on TC 8 requiring some different configuration for 
SQL connections?  I just installed 8.0.15 on three servers (see last 
week's post regarding errors on 8.0.17).  All three servers work for a 
while.  Then after about an hour I start getting the following errors:

java.sql.SQLException: Cannot get a connection, general error
         at 
org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:130)
         at 
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)

I bounce Tomcat, and it works again for another hour or so.  Then it 
hits again.

None of the servers are high-traffic.  I can pretty much guarantee I'm 
not truly using up all connections.

This is failing identically on all three servers (unrelated customers 
and unrelated apps... just migrated all my servers at the same time).

I moved back to Tomcat 7, no change otherwise to config, etc.  The 
problem went away on all servers.   So it's definitely related to TC 8.

Please help.  I want to move up to TC 8.  Do I need to make some 
mandatory config changes to something to make TC 8 happy with regard to 
SQL connections?  Or do I have some catastrophic bug in my code with 
regard to connections that TC7 was letting slide and TC8 is now 
enforcing?  If so, is there a way to monitor TC's connection pool stats 
and figure this out?

Thanks.

Jerry





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 SQL Connection Problems

Posted by Jerry Malcolm <te...@malcolms.com>.
On 2/10/2015 12:30 PM, Konstantin Kolinko wrote:
> re are configuration differences between DBCP 1.x pool (in Tomcat 7) 
> and DBCP 2.x (in Tomcat 8). It is mentioned in the Tomcat Migration 
> Guide. 
> http://tomcat.apache.org/migration-8.html#Database_Connection_Pooling 
> Best regards, Konstantin Kolinko
Konstantin,

My fault for not reading the migration notes closer.  Thanks for the 
info.  I'm just surprised that the xml parser didn't flag my now-invalid 
maxActive, etc parms on the Resource tags.

Hopefully smooth sailing now that I've updated all the references.

Jerry

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 SQL Connection Problems

Posted by Konstantin Kolinko <kn...@gmail.com>.
2015-02-10 20:22 GMT+03:00 Jerry Malcolm <te...@malcolms.com>:
> Has something changed on TC 8 requiring some different configuration for SQL
> connections?  I just installed 8.0.15 on three servers (see last week's post
> regarding errors on 8.0.17).  All three servers work for a while.  Then
> after about an hour I start getting the following errors:
>
> java.sql.SQLException: Cannot get a connection, general error
>         at
> org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:130)
>         at
> org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1412)
>
> I bounce Tomcat, and it works again for another hour or so.  Then it hits
> again.
>
> None of the servers are high-traffic.  I can pretty much guarantee I'm not
> truly using up all connections.
>
> This is failing identically on all three servers (unrelated customers and
> unrelated apps... just migrated all my servers at the same time).
>
> I moved back to Tomcat 7, no change otherwise to config, etc.  The problem
> went away on all servers.   So it's definitely related to TC 8.
>
> Please help.  I want to move up to TC 8.  Do I need to make some mandatory
> config changes to something to make TC 8 happy with regard to SQL
> connections?  Or do I have some catastrophic bug in my code with regard to
> connections that TC7 was letting slide and TC8 is now enforcing?  If so, is
> there a way to monitor TC's connection pool stats and figure this out?

Note that there are configuration differences between DBCP 1.x pool
(in Tomcat 7) and DBCP 2.x (in Tomcat 8).  It is mentioned in the
Tomcat Migration Guide.

http://tomcat.apache.org/migration-8.html#Database_Connection_Pooling

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 SQL Connection Problems

Posted by Jerry Malcolm <te...@malcolms.com>.
Filip,

Thanks for the response.  But what am I looking for in that document?  I 
understand how jdbc connection pooling works.  I need to know why code 
that has worked for years is now failing only after moving to Tomcat 8.

Jerry

On 2/10/2015 11:55 AM, Filip Hanik wrote:
> Try
> http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
>
> On Tue, Feb 10, 2015 at 10:22 AM, Jerry Malcolm <te...@malcolms.com>
> wrote:
>
>> Has something changed on TC 8 requiring some different configuration for
>> SQL connections?  I just installed 8.0.15 on three servers (see last week's
>> post regarding errors on 8.0.17).  All three servers work for a while.
>> Then after about an hour I start getting the following errors:
>>
>> java.sql.SQLException: Cannot get a connection, general error
>>          at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(
>> PoolingDataSource.java:130)
>>          at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(
>> BasicDataSource.java:1412)
>>
>> I bounce Tomcat, and it works again for another hour or so.  Then it hits
>> again.
>>
>> None of the servers are high-traffic.  I can pretty much guarantee I'm not
>> truly using up all connections.
>>
>> This is failing identically on all three servers (unrelated customers and
>> unrelated apps... just migrated all my servers at the same time).
>>
>> I moved back to Tomcat 7, no change otherwise to config, etc.  The problem
>> went away on all servers.   So it's definitely related to TC 8.
>>
>> Please help.  I want to move up to TC 8.  Do I need to make some mandatory
>> config changes to something to make TC 8 happy with regard to SQL
>> connections?  Or do I have some catastrophic bug in my code with regard to
>> connections that TC7 was letting slide and TC8 is now enforcing?  If so, is
>> there a way to monitor TC's connection pool stats and figure this out?
>>
>> Thanks.
>>
>> Jerry
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2015.0.5646 / Virus Database: 4284/9089 - Release Date: 02/10/15


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 8 SQL Connection Problems

Posted by Filip Hanik <fi...@hanik.com>.
Try
http://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html

On Tue, Feb 10, 2015 at 10:22 AM, Jerry Malcolm <te...@malcolms.com>
wrote:

> Has something changed on TC 8 requiring some different configuration for
> SQL connections?  I just installed 8.0.15 on three servers (see last week's
> post regarding errors on 8.0.17).  All three servers work for a while.
> Then after about an hour I start getting the following errors:
>
> java.sql.SQLException: Cannot get a connection, general error
>         at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(
> PoolingDataSource.java:130)
>         at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(
> BasicDataSource.java:1412)
>
> I bounce Tomcat, and it works again for another hour or so.  Then it hits
> again.
>
> None of the servers are high-traffic.  I can pretty much guarantee I'm not
> truly using up all connections.
>
> This is failing identically on all three servers (unrelated customers and
> unrelated apps... just migrated all my servers at the same time).
>
> I moved back to Tomcat 7, no change otherwise to config, etc.  The problem
> went away on all servers.   So it's definitely related to TC 8.
>
> Please help.  I want to move up to TC 8.  Do I need to make some mandatory
> config changes to something to make TC 8 happy with regard to SQL
> connections?  Or do I have some catastrophic bug in my code with regard to
> connections that TC7 was letting slide and TC8 is now enforcing?  If so, is
> there a way to monitor TC's connection pool stats and figure this out?
>
> Thanks.
>
> Jerry
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>