Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3
c3p0 version: c3p0-0.8.5
General question regarding reconnection upong connection loss to MySQL database. Previously I was using the hibernate (not for production use) connection pooling mechanism and got a few communications link failure exception. I tried adding some code to deal with these different communication link failure problems, but to no avail. I read online mesasge boards and did quite a few searches, and found out about c3p0's support for automatically re-acquiring lost connection.
My question is, if I have successfuly set the properties in c3p0.properties:
c3p0.acquireRetryAttempts=-1
c3p0.automaticTestTable=C3P0TestTable
c3p0.initialPoolSize=20
c3p0.acquire_increment=5
c3p0.idle_connection_test_period=36000
c3p0.max_idle_time=0
c3p0.timeout=18000
etc.
then I would not need to do checks on whether a session is connected or not (e.g. session.isConnected() etc) and just delegate to c3p0 to make sure connections are still up and if it is lost, c3p0 will reacquire it?
My application implement short conversations, where i open/close transactions/sessions immediately after action on the database. The fear is only at the very end when I use a ScrollableResults to update a massive amount of data, that connections might get lost in between.
Thanks,
E