Sometimes OCI invalid handle error
Posted: Wed 04 Dec 2019 16:45
Hello Support team,
We have got a web application which throws OCI invalid handle exceptions sometimes.
Message: OCI invalid handle.
Source: Devart.Data.Oracle
StackTrace: at Devart.Data.Oracle.bx.d(Int32 A_0)
at Devart.Data.Oracle.dw.b(Int32 A_0)
at Devart.Data.Oracle.OracleDataReader.Read()
Code:
We use dotConnect for Oracle 9.9.867.0.
Do you have any idea what should I try to get rid of this exception?
Thanks in advance for your help.
Istvan
We have got a web application which throws OCI invalid handle exceptions sometimes.
Message: OCI invalid handle.
Source: Devart.Data.Oracle
StackTrace: at Devart.Data.Oracle.bx.d(Int32 A_0)
at Devart.Data.Oracle.dw.b(Int32 A_0)
at Devart.Data.Oracle.OracleDataReader.Read()
Code:
Code: Select all
OracleCommand mo_Command = new OracleCommand();
mo_Command.CommandText = "select sys_context('USERENV','SID') as sid from dual";
mo_Command.CommandType = System.Data.CommandType.Text;
mo_Command.Connection = mo_Connection;
decimal mn_Sid = -1;
using (OracleCursor mo_Cursor = mo_Command.ExecuteCursor())
{
using (OracleDataReader mo_Reader = mo_Cursor.GetDataReader())
{
mo_Reader.Read(); //throws OCI invalid handle sometimes
mn_Sid = mo_Reader.GetDecimal(0);
mo_Reader.Close();
}
}
mo_ConnectionDescriptor.ConnectionSID = mn_Sid;
Do you have any idea what should I try to get rid of this exception?
Thanks in advance for your help.
Istvan