-->
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.  [ 2 posts ] 
Author Message
 Post subject: DB connection failure once network failure and reestablish
PostPosted: Mon Dec 28, 2009 9:05 am 
Newbie

Joined: Mon Dec 28, 2009 6:56 am
Posts: 2
hi
i use hibernate and the settings are below
Code:
     <property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
     <property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:jtds:sqlserver://VDEVSERVER02:1433/DBTest;Integrated Security=SSPI;Trusted_Connection=Yes</property>
      <property name="hibernate.connection.username">sa</property>
      <property name="hibernate.connection.password">password345</property>


every thing is fine. i application fails in a case. the case is
1) i started application(DB connections are made and application works fine)
2) i unplug the network cable
3) i plug it again
4) my db queries fail(if i try login the login fails twice and my third login attempt succeeded,i debugged my first two sessions from sessionfactory are failing to begin a transaction)

if i rebuild the sessionfactory for each individual session every session is able to execute query
here is the exception
Code:
org.hibernate.TransactionException: JDBC begin failed:
   at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:96)
   at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
   at com.vichara.space.server.database.VSpaceDAOCommons.getDataCount(VSpaceDAOCommons.java:63)
   at com.vichara.space.server.database.VSpaceWebDAO.validateUser(VSpaceWebDAO.java:73)
   at com.vichara.space.server.web.WebRequestHandler.validate(WebRequestHandler.java:1134)
   at com.vichara.space.server.web.VSpaceMonitorServlet.doPost(VSpaceMonitorServlet.java:62)
   at com.vichara.space.server.web.VSpaceMonitorServlet.doGet(VSpaceMonitorServlet.java:40)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
   at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
   at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
   at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
   at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
   at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
   at org.mortbay.jetty.Server.handle(Server.java:320)
   at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
   at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
   at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
   at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
   at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
   at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
   at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
Caused by: java.sql.SQLException: I/O Error: Connection reset by peer: socket write error
   at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1052)
   at net.sourceforge.jtds.jdbc.TdsCore.submitSQL(TdsCore.java:898)
   at net.sourceforge.jtds.jdbc.ConnectionJDBC2.setAutoCommit(ConnectionJDBC2.java:2175)
   at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:91)
   ... 22 more
Caused by: java.net.SocketException: Connection reset by peer: socket write error
   at java.net.SocketOutputStream.socketWrite0(Native Method)
   at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
   at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
   at java.io.DataOutputStream.write(DataOutputStream.java:90)
   at net.sourceforge.jtds.jdbc.SharedSocket.sendNetPacket(SharedSocket.java:671)
   at net.sourceforge.jtds.jdbc.RequestStream.putPacket(RequestStream.java:560)
   at net.sourceforge.jtds.jdbc.RequestStream.flush(RequestStream.java:508)
   at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1039)
   ... 25 more

i am looking for a solution like without rebuilding the session factory all the time i need open a valid session from it all the time
any clue?
Thanks
R


Top
 Profile  
 
 Post subject: Re: DB connection failure once network failure and reestablish
PostPosted: Tue Dec 29, 2009 3:40 am 
Newbie

Joined: Mon Dec 28, 2009 6:56 am
Posts: 2
any help?


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

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.