I am deploying my web app war thru tomcat6.0 on Windows 2003 - I am not
changing any tomcat configuration files directly (or indirectly, afaik). 
My app is using Hibernate for DB access and I have added c3p0 to handle DB
connection pooling to Hibernate. 
I am seeing some strange results, that lead me to believe that tomcat is
honoring the c3p0 max threads configuration, tho I believe this should not
be happenning.
When I set c3p0 max threads to a large number, I have no problem with my
app. When I set the max threads in c3p0 to smaller values, I see the
following problem:
- my client (written in GWT) executes a loop as follows:
    1 - remote call to web app to start a DB transaction (essentially
reserving a 3cp0 connection)
    2 - on callback from 1, make a remote call to web app to perform a DB
query using the above transaction
    3 - on callback from 2, make a remote call to the web app to commit the
db transaction (freeing the c3p0 connection)

The problem occurs if I set max threads to N and execute the above loop N+1
or more times (where N is a small number like 3 or 4). I see Tomcat threads
sitting in c3p0 code waiting for a connection. There is no thread handling
the incoming commit calls (step 3 above). The initial N iterations thru the
loop all complete their DB transaction, they just hang while trying to
commit the transaction.

If I execute the loop N-1 times, I have no problems - I can execute my loop
over and over. I can verify that I am not leaking connections (I have a
monitor thread that displays the number of active connections).

I've got logging turned on in both the client and my web app that shows that
my commit code is running in the client, but the request to my server is
never received.

As strange as it seems, my experiments leads me to believe that Tomcat is
honoring the c3p0 max threads.

Any help or insight is appreciated.

-- 
View this message in context: 
http://www.nabble.com/Tomcat-thread-pool-question-tp20915752p20915752.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to