I am using Oracle.ManagedDataAccess.Core 2.18.6 to connect oracle DB.When i call con.Open()
getting issue ORA-00604: error occurred at recursive SQL level 1 ORA-01882: timezone region not found...Oracle Data Provider for .NET, Managed Driver With .Net Core 2.2. After implemented below solution still getting same error.
-My Code:
DataTable dt = new DataTable();
Console.WriteLine("Called ");
using (OracleConnection Connection = new OracleConnection(utilityManager.Decrypt(ConnString)))
{
Console.WriteLine("********* Before Connection Open********* ");
Connection.Open();
Console.WriteLine("********* Connection Open********* ");
OracleDataAdapter DataAdapter = new OracleDataAdapter();
using (OracleCommand cmd = new OracleCommand(strSQL, Connection))
{
cmd.BindByName = true;
cmd.CommandText = strSQL;
cmd.CommandType = CommandType.Text;
DataAdapter.SelectCommand = cmd;
DataSet ds = new DataSet();
DataAdapter.Fill(ds);
dt = ds.Tables[0];
}
}
Solution I tried :
-Set timezone in docker file as below
ENV TZ=America/New_York
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-Use OracleGlobalization class
this.Connection = new OracleConnection();
this.Connection.ConnectionString = ...
this.Connection.Open();
OracleGlobalization info = this.Connection.GetSessionInfo();
info.TimeZone = "America/New_York";
this.Connection.SetSessionInfo(info)
-https://serverfault.com/questions/683605/docker-container-time-timezone-will-not-reflect-changes