TomcatExpert

JDBC Connection Pool Timeout Errors

posted by SpringSource on February 9, 2010 12:44 PM

If the database server times out a connection, the connection pool on Tomcat side would not be aware of its disconnection.

If the database server times out a connection, the connection pool on Tomcat side would not be aware of its disconnection, and could throw the following exception in Tomcat:

Caused by: com.ibm.db2.jcc.c.DisconnectException: A communication error has been detected.
Communication protocol being used: Reply.fill().
Communication API being used: InputStream.read().
Location where the error was detected: Read timed out.
Communication function detecting the error: *. Protocol specific error codes(s) TCP/IP SOCKETS DB2ConnectionCorrelator: CCD3560A.K404.080507130918
at com.ibm.db2.jcc.b.a.a(a.java:373)
at com.ibm.db2.jcc.b.gb.b(gb.java:191)
at com.ibm.db2.jcc.b.gb.c(gb.java:238)
at com.ibm.db2.jcc.b.gb.c(gb.java:353)
at com.ibm.db2.jcc.b.gb.v(gb.java:1362)

In order to prevent the exception, the connection pool can validate the connection.

In doing so, two attributes can be added to the JDBC resource, testOnBorrow and validationQuery respectively:

name="jdbc/dsSos"
auth="Container"
type="javax.sql.DataSource"
username="******"
password="*******"
driverClassName="com.ibm.db2.jcc.DB2Driver"
factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
maxIdle="2"
maxWait="10000"
url="jdbc:db2://mydbURL:50000/MYDB"
maxActive="15"
removeAbandoned="true"
removeAbandonedTimeout="300"
testOnBorrow="true"
validationQuery="some sql..."
logAbandoned="true"
"some sql..."

In the above example should be a valid SQL query that the connection pool will execute to ensure a live connection is returned to the application. The embedded query should be simple and efficient. For example:

For Oracle:

validationQuery="select 1 from dual"

 

For MySQL:

validationQuery="select 1"
For more than 10 years, SpringSource employees have been supporting Apache technologies, with unparalleled experience and commitment to the Apache Software Foundation. More than 400 of the Fortune 500 count on SpringSource to support their mission-critical business applications. Leaders of the Apache Software Foundation, including Board Members, work at SpringSource and dedicate a significant amount of time further developing the Apache Tomcat open source project. Over the last 2 years, 95% of the issues fixed in the Apache Tomcat project were fixed by SpringSource engineers. For more information on how SpringSource can help your enterprise, see the SpringSource website, or call 800/444-1935.

Comments

Impact of two parameters

The addition of these two parameters very onerous database?

JAva

twitter followers I really

twitter followers I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful. buy youtube views

nice

This is something that most of you would not have even care to see through in the first place. It will surely be good if they do make some significant changes that will make things much more easier than now. jewish temple los angeles

castle clash hack no survey

castle clash hack no survey no password I recommend only good and reliable information, so see it: clash of clans juwelen hack android

My spouse and i study the

My spouse and i study the many web sites to have the most up-to-date on the can be found in producing solutions. Obtaining a writesmyessay is just not a new onetime issue. It is just a course of action that particular has got to regularly move through in order to keep way up in doing what can be purchased.

--

cara install windows 7 What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.jenis processor intel,cara melihat spesifikasi komputer,perangkat keras komputer dan fungsinya,cara install ulang windows 7,sejarah perkembangan dan generasi komputer

David

twitter followers I simply want to tell you that I am new to weblog and definitely liked this blog site. Very likely I’m going to bookmark your blog . You absolutely have wonderful stories. Cheers for sharing with us your blog. favorites

That's bad for you because

That's bad for you because those are the things that make your items stand out, improve your response amount, and drive item sales Channel Management.

wow man

This site is very helpful to know the details of errors occurring during JDBC connection. Connection timed out problems will be there while doing many jobs. But we don’t know the reason behind it. These sites will be helpful to know the reasons for it. medical billing services los angeles

You bear through a awesome

You bear through a awesome vacancy. I sanity definitely quarry it moreover personally suggest to my buddys. I am self-possessed they determination be benefited from this scene. ppc manager

I understand this column. I

I understand this column. I realize You put a many of struggle to found this story. I admire your process. Language of Desires

I wrote about a similar

I wrote about a similar issue, I give you the link to my site. Real Estate Agent

On that website page, you'll

On that website page, you'll see your description, why not read through this. WinningFT

I am interested in such

I am interested in such topics so I will address page where it is cool described. dieta del medio dia descargar gratis pdf

On this page you can read

On this page you can read my interests, write something special. how to get more views on youtube

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.