4

We have a problem in our C# project using PetaPoco micro-orm. Our Oracle database is on another machine and if we bring that machine down for maintenance or fault we got this error in C# PetaPoco:

Exception="Connection request timed out
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, 
OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object 
src, String procedure, Boolean bCheck, Int32 isRecoverable, 
OracleLogicalTransaction m_OracleLogicalTransaction)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, 
OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction 
m_oracleLogicalTransaction)
at Oracle.DataAccess.Client.OracleConnection.Open()

This is OK, but when the database came back up we still got the same error when trying to open the database: Exception="Connection request timed out...

I tried to set Max Pool Size to a low number (eg. 3) and try to open multiple connections without closing them to replicate the problem. Unfortunately, I got a different error from this experiment: Pooled Connection request timed out

This happens when the database PC is down overnight. Testing with SQLDeveloper the connection to the database works.

Any advice? Thanks

Suciu Eus
  • 169
  • 1
  • 8
  • What do you do to clear the problem? Do you recycle an app pool? Does rebooting the application machine clear the issue? – dandarc Aug 22 '18 at 17:29
  • 1
    Restarting IIS resolves the problem. But if all pool connections are used, why I don't get the "Pooled connection request timeout" and I get "Connection request timed out"... – Suciu Eus Aug 23 '18 at 05:44
  • We are facing the same issue as described in the question. But we are not able to fix. Whenever we are facing issue with our application, we are getting error message as Connection Request Time Out(Clearly stated in question) for fixing this we are manually recycling the app pool. Our understanding is, this issue occurring whenever we have network issue(between application server and DB server), we need to manually recycle app pool to clear the existing connections.Is it due to network issue only or any other possibilities? – Sathiya Kumar V M Jun 12 '19 at 14:00
  • Have you tried to call `OracleConnection.ClearPool(conn)` with `conn` the connection instance that failed if you have it, or probably better `OracleConnection.ClearAllPools()`, on any error of that type. – Simon Mourier Jun 12 '19 at 17:21
  • @SimonMourier Thanks for your response. No we have not tried this. – Sathiya Kumar V M Jun 13 '19 at 11:00
  • 1
    @SathiyaKumar - Well, that would be worth a try. – Simon Mourier Jun 14 '19 at 07:57

1 Answers1

0

I was getting the pooled connection request timeouts on a development workstation a couple weeks ago.

I was able to clear that by putting the connection description directly into the connection string instead of using TNS.

Instead of

...Data Source = MyTNSDescription...

I put this in the Web.config connection string

... Data Source = (DESCRIPTION =(ADDRESS = <rest of connection description>...

And suddenly the problem went away. If the problem is something to do with your specific configuration of Oracle Client / TNS, that might get you working quickly. It is a quick thing to try anyway.

dandarc
  • 678
  • 3
  • 7