Hi,
I have developed an application (with hibernate) with the backend database being a MS SQL Server. I have deployed this application on Resin over a week ago. However one of my friends reported that he had an exception thrown to him (something I left on purpose at the moment). The exception thrown was:
Code:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection
reset by peer: socket write error
Now to make the system run again I just restarted the resin service, and everything worked fine. However I know this is not the solution for the problem, and therefore I did some extra research using Google and the many forums out there (including this one).
What I found out is that this exception is usually thrown because of a network failure. Now this is hardly possible in my scenario because both database and application servers (in this case resin / IIS) are both on the same computer.
Now I have the feeling that this could be because of unclosed connections. Is it possible that too many connections are being created, and therefore that exception is being thrown?
On a post (in this same forum) it seems to be blame DBCP for this, and says that proxool is a better tool. But this post is dated 26th August 2003. Now I am using Hibernate 3.0 and do not know if this is till the point. Other posts say it is something with Oracle, and others with JBoss (but I am not using both), and most of the others I found are un answerd!
I would greatly appreciate any comments, even if you suggest me ways I how I can cornet this problem and see why it is coming out. My only problem (and fear) is that it seems to come out over a long period of time (this is why I am feeling as if it is some kind of unclosed connection :S)
Thanks and regards,
Sim085
ps: this is all the stack trace (do not know it would help):
Code:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection
reset by peer: socket write error
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.submitRequest(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1492)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
at com.school.dao.impl.AccountDAO.findByUserName(Unknown Source)
at com.school.service.impl.BaseAccountService.checkUserNameAvailable(Unknown Source)
at com.school.forms.RegisterForm.validate(Unknown Source)
at com.school.actions.RegisterUserAction.doCreate(Unknown Source)
at com.school.actions.RegisterUserAction.executeAction(Unknown Source)
at com.school.actions.RegisterUserAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:154)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
at com.caucho.server.hmux.HmuxRequest.handleRequest(HmuxRequest.java:419)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:492)
at com.caucho.util.ThreadPool.run(ThreadPool.java:425)
at java.lang.Thread.run(Thread.java:595)