0

I saw many posts regarding this Error but didn't find any suitable solution. I am not getting any error for while after the code is running then after some time i'll get this error. I don't know what to do and where to check for the mistake.

If anyone help me in getting this problem solved.

1 Answers1

0

I don't know, but... Could it be you are mantaining an open connection for too long? - May be you should open the connection, perform the operations you need, and then close it. If the connection is open from the application's point of view but the server decided to close it after an inactivity period, this could be the source of the error.

Fernando
  • 309
  • 1
  • 5
  • Yes, my connection is open for a long time but, it is performing some operation continuously. Is there a way by which I can close the connection then create the connection again and resume the process. – Rahul Mittal May 15 '14 at 09:15
  • It depends on thousand of factors. I think you need to give more details for someone to help you (Application architecture, type of network Internet/intranet,VPN, etc., 2 or 3 layers...). You could try to tune up the server and client parameters for communications (timeout, connection numbers and so on...) and also you can change the way your app comunicates with de DB. You can open-query-close, or you can use a connections pool, or you can write a helper class that encapsulates the DB access, with some methods that catch this error and reopen the connection when needed. – Fernando May 15 '14 at 09:27