I am using Hibernate 3 and I am facing a problem related to connections being closed.
I am using c3p0-0.9.1.2.jar and I checked onto the connections to database server opened by Hibernate, I found that there are established connections which are 5 in number; at some TCP ports of server (see below log).
But these established connections keeps on changing the TCP Ports on which they are established and thus releasing the earlier ports used by them, making these ports in TIME_WAIT state (rather than closing them).
This keeps on going and make the count in hundreds; for connections in TIME_WAIT condition.
I am not sure what is happening and why the ports are switching from Established to TIME_WAIT and none of the earlier ones are closing.
Below is the sample taken by running NETSTAT -ano|find "x.9" where x.9 is database server IP.
TCP x.124.x.66:4379 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4381 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4382 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4383 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4384 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4385 x.124.x.9:1433 TIME_WAIT 0
TCP x.124.x.66:4386 x.124.x.9:1433 ESTABLISHED 5916
TCP x.124.x.66:4387 x.124.x.9:1433 ESTABLISHED 5916
TCP x.124.x.66:4388 x.124.x.9:1433 ESTABLISHED 5916
TCP x.124.x.66:4389 x.124.x.9:1433 ESTABLISHED 5916
TCP x.124.x.66:4390 x.124.x.9:1433 ESTABLISHED 5916
Hibernate.properties file used by me.
hibernate.c3p0.min_size=5
hibernate.c3p0.timeout=2
hibernate.c3p0.max_size=50
hibernate.c3p0.idle_test_period=10000
hibernate.connection.release_mode=auto
Thanks for help.