0

I have an ASP.NET Core Web API which works with oracleclient.dll.

When I publish this service to IIS, after a while, I get "ORA-03114" errors. But when I recycle the application pool, the API works successfully again.

What can I do to fix this problem?

Tiny Wang
  • 10,423
  • 1
  • 11
  • 29
  • Since it works initially, and again after you recycle the pool, the most likely explanation is that there is an issue with the network that forces a disconnect. It could literally be _anything_ with the network. All this error tells you is that Oracle tried to use the connection and discovered that it was broken. Oracle has no way of knowing what caused the disconnect. – pmdba Aug 28 '21 at 03:37
  • I dont Know Maybe network has problem in moment But when I trace My Api Working Currectly – hamid reza Heydari Aug 28 '21 at 04:07
  • The problem may not be in your API; it could be something external to your application causing the disconnect. – pmdba Aug 28 '21 at 04:12
  • but after disconnect my application can not connect again – hamid reza Heydari Aug 28 '21 at 04:18
  • until restart in iis or recycle apppool – hamid reza Heydari Aug 28 '21 at 04:20
  • The perhaps there's a resource leak in your connection pool, if it won't work again until it is recycled. Could be memory, or a connection leak if connections aren't being closed properly and new ones opened. All the error message is telling you is that the existing connection is broken. Do you get a different error attempting to reconnect without recycling the pool? – pmdba Aug 28 '21 at 04:22
  • no I havent any error after recycle – hamid reza Heydari Aug 28 '21 at 04:24
  • This is my Code OracleDataAdapter da = new OracleDataAdapter(query,con); DataTable dt = new DataTable(); da.Fill(dt); con.Close(); return dt; – hamid reza Heydari Aug 28 '21 at 04:24
  • what be happend if I dispose my connection – hamid reza Heydari Aug 28 '21 at 04:27

1 Answers1

0

Finaly I Find It.Change DependencyInjection Mode From AddScoped To AddTransient. Thanks Everybody