I am new in using hibernate connection, i am having difficulties in checking the connection before executing a query. Currently if i execute a query, my java swing application hangs roughly around 30 seconds before it confirms that the connection is not available. I already used session.isConnected() but even the server is down, the return is always true. Please help.Thanks
Here is my connection properties :
"hibernate.connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider"
"hibernate.c3p0.validate", "true"
"hibernate.c3p0.acquire_increment", "2"
"hibernate.c3p0.idle_test_period", "30"
"hibernate.c3p0.min_size", "5"
"hibernate.c3p0.max_size", "25"
"hibernate.c3p0.max_statements", "0"
"hibernate.c3p0.testConnectionOnCheckout", "true"
"hibernate.c3p0.testConnectionOnCheckIn", "true"
"hibernate.c3p0.preferredTestQuery", "SELECT 1"
"hibernate.c3p0.acquireRetryAttempts", "3"
"hibernate.c3p0.acquireRetryDelay", "200"
"hibernate.c3p0.timeout", "1000"
"hibernate.c3p0.maxConnectionAge", "1100"
"hibernate.connection.autoReconnect", "true"
"javax.persistence.lock.timeout", "1"
"javax.persistence.query.timeout", "1"