views:

233

answers:

1

Hi,

I have a .Net service that connects to an Oracle database on every request. It works fine at the beginning, but after some number of requests I start getting:

Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact
   at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
   at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
   at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
   at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
   at MyApp.Services.OracleConnectionWithRetry.ExecuteReader(OracleCommand command)
   ...

Any idea what might be the problem? I dispose all the connections, results and parameters. The load on this service is, well, very low.

+1  A: 

I have seen this happen too; try turning off connection pooling with "Pooling=false" in the connection string. I have a theory that idle connections in the pool expire, but ODP.NET does not realize that they have expired, and then when your app grabs one and tries to do something you get that exception.

William Gross
Someone also suggested that this happens after the database gets bounced.
Grzenio