0

Our web application(dotnet framework 4.7) is running in IIS. Am using ODP.net OracleManagedDataProvider for oracle database.

We have dynamic report page which shows data from views. The problem is whenever we alter the view, we are experiencing the below issue

System.IndexOutOfRangeException: Index was outside the bounds of the array.    at Oracle.ManagedDataAccess.Client.OracleDataReader.GetMinSchemaTable()

We can solve this issue by recycling the app pool. I know that it is not perfect solution.

I think the schema information is being cached in ConnectionPool. Is there anyway we can clear it or please guide to me to solve this..

var dsResult = new DataSet();
  var objCmd = new OracleCommand();
        OracleConnection objConn = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString);
        try
        {
            objConn.Open();
            objCmd.Connection = objConn;
            objCmd.CommandText = par_command;
            OracleDataAdapter objDA = new OracleDataAdapter(objCmd);
            objDA.Fill(dsResult);
        }
        catch 
        {
        }
        finally
        {
            objCmd.Dispose();
            objConn.Close();
        }
Bala
  • 149
  • 1
  • 7
  • you can start by providing explanation on *`We have dynamic report page`* - what technology you use to populate report, what report tools you use, is this lie a third party etc. Preferably with some code. – T.S. Aug 17 '22 at 14:03
  • Its developed using asp.net webforms. We have written code to convert HTML table to RDLC file and load RDLC file with dataset.. thats why we call it dynamic reporting tool. its not from third party.. we are loading DataTable using ADO.Net. I have included the code also. – Bala Aug 18 '22 at 10:13
  • 1
    So... now it is obvious to me. You need this `objCmd.AddToStatementCache = false;` In fact [This has been answered here](https://stackoverflow.com/questions/71617460/how-to-clear-oracle-manageddataaccess-client-table-structure-cache) – T.S. Aug 18 '22 at 14:04
  • thank you very much... I was searching for clearing schema information.. its great to be in this community.. pls post it as answer i will accept.. thank you.. – Bala Aug 19 '22 at 04:26
  • may be you should post an additional answer with your view caching example and how to deal with it in the link I supplied. The answer to your question already exists, – T.S. Aug 19 '22 at 13:55

0 Answers0