Problem is how to reconnect to database Oracle after troubles
I have .net Core web-api project in docker, where I connect to Oracle database. For connecting I use nugget package oracleClientCore
How I connect and call stoted procedure:
string cs = "Data Source = 172.10.200.100:1521/dev;PERSIST SECURITY INFO=True;USER ID=test; Password=devtest;";
using (OracleConnection connection = new OracleConnection(cs)){
connection.Open();
using (OracleCommand cmd = connection.CreateCommand()) {
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_check_db";
cmd.ExecuteNonQuery();
connection.Close();
}
}
In stored procedure sp_check_db just make insert into table
Sometimes the connection to database falling down and I got exception ORA-03114: not connected to ORACLE. After the database was enabled again I continue to receive same error ORA-03114: not connected to ORACLE till I rebuild and redeploy the project.
What can I do in this situation, it's not right behavior? Something wrong with my code or connection string?