My java program has a connection pool (Min 5 Max 30). I found from time to time it will fail to get a connection, and this troubles me. I see the pool resource is not used up. There are 4 exceptions caught:
I want to ask how to troubleshoot such case. want to know the statistics for all connections, all pools; what are the activities that happened. What errors caused the connection to fail..
I tried the best to search the documentation and it looks like there is something called TDP but that is for channel-attached client. I think mine is network-attached client.
I will appreciate for any replies, thanks in advance. And please don't mind if this is a stupid question.
You appear to be using c3p0 connection pooling. Please provide your configuration, e.g. c3p0.properties file, if that's what you're using.
have no c3p0.propertis file, its configuration looks in the project configuration file,
Your issues appear to be with c3p0, not the Teradata JDBC Driver. We recommend studying information available for c3p0.
Fo example, the following forum thread describes a symptom similar to yours:
Troubleshooting advice from that thread:
"Try enabling logging and setting the
c3p0.debugUnreturnedConnectionStackTraces property to true. Also set
c3p0.unreturnedConnectionTimeout to something smaller than your average query time (1 sec?). Then any thing that takes longer than the timeout will log a stack trace. This should allow you to narrow down things pretty quickly. If there's no pattern to the stack traces, it could just be that your pool is too small. You said 100 concurrent users, but any idea how many queries per second this is? If it's 100 queries per second and you have 20 connections, then each sql execution needs to take less than 200 ms (20 connections => 20 total seconds of work per sec of wall clock time to do 100 queries)."