Someone has already encountered the following problem: When an error occurs that should be of type OracleException, but in its place an Exception is triggered, then the oracle processing is not applied because of this (the "..." are deprecated implementations).
See example:
using (OracleConnection connection = new OracleConnection(ConfigurationManager.ConnectionStrings["Oracle"].ConnectionString))
using (OracleCommand command = connection.CreateCommand())
{
try
{
//connection.Open(); //PARA PROVOCAR ERRO ORACLE
(...)
//Captura resultado em um DataReader
//AO EXECUTAR ISTO NÃO LEVANTA ERRO ORACLE E SIM UM EXCEPTION SIMPLES.
using (Oracle.ManagedDataAccess.Client.OracleDataReader retornoBanco = command.ExecuteReader())
{
(...)
}
(...)
}
catch (OracleException oe)
{
(...)
switch (erroCodeOracle)
{
case 12571:
(...)
break;
default:
(...)
break;
}
}
}
Do not enter CATCH above! But the error you return is "Connection is not open ..."