-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: "Cannot open Connection" issues using Hibernate
PostPosted: Wed Sep 23, 2009 12:42 am 
Newbie

Joined: Wed Sep 23, 2009 12:30 am
Posts: 1
Hi,

We are using the Hibernate in our customer environment and often we find this exception occurring in a regular basis within a span of two weeks.

I wanted to know two things :
1. What is the cause of these exceptions ?
2. What configuration parameters we need to set to overcome such issues ?

Below are the Hibernate Properties we set

props.setProperty("hibernate.c3p0.idle_test_period", configuration.getParameter("IdleTestPeriod", "600"));
props.setProperty("hibernate.c3p0.max_size", configuration.getParameter("MaxPoolSize", "100"));
props.setProperty("hibernate.c3p0.min_size", configuration.getParameter("MinPoolSize", "5"));
props.setProperty("hibernate.c3p0.timeout", configuration.getParameter("MaxIdleTime", "3600"));
props.setProperty("hibernate.c3p0.acquire_increment", configuration.getParameter("AcquireIncrement", "5"));
System.setProperty("c3p0.maxIdleTimeExcessConnections", configuration.getParameter("MaxIdleTimeExcessConnections", "120"));

Below is the exception we get in our logs :
org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:40)
at $Proxy0.setAutoCommit(Unknown Source)
at com.novell.zenworks.inventory.rtr.actionclasses.schedule.QueryRunner.run(QueryRunner.java:160)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: I/O Error: Connection reset
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1049)
at net.sourceforge.jtds.jdbc.TdsCore.submitSQL(TdsCore.java:895)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.setAutoCommit(ConnectionJDBC2.java:2026)
at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:881)
at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:37)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
... 5 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.DataInputStream.readFully(DataInputStream.java:176)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:826)
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:707)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103)
at net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:88)
at net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3870)
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1042)
... 10 more


thanks
Naveen


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.