Oracle.ManagedDataAccess.Client.OracleDataReader.GetMinSchemaTable()出现“Index is beyond the bounds of — oracle-tech

    Forum Stats

  • 3,716,134 Users
  • 2,242,961 Discussions
  • 7,845,841 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Oracle.ManagedDataAccess.Client.OracleDataReader.GetMinSchemaTable()出现“Index is beyond the bounds of

3142656
3142656 Member Posts: 3
edited April 2018 in ODP.NET

索引超出了数组界限。

I think I must express the problem in english though my english is poor!

the exception means  “Index is beyond the bounds of the array"


2   在 Oracle.ManagedDataAccess.Client.OracleDataReader.GetMinSchemaTable()
3   在 Oracle.ManagedDataAccess.Client.OracleDataReader.set_IsFillReader(Boolean value)
4   在 Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
5   在 Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
6   在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
7   在 EdiSharp.Utility.Data.OracleManagedDbHelperBase.GetDataTable(String sql)
8   在 Cot_DataFactory.OracleDAL.OracleDBHelper.GetDataTable(String SQLString)
9   在 Cot_DataFactory.BLL.B_CtnDymanic.ChangeLYGTZW(String wt_no, String ctn, Int32 state, String strIODate)
10   在 Cot_DataFactory.BLL.B_CtnDymanic.FullCtnOut(String wt_no, String ctn, String ctn_type, String ctn_corp, String strIODate)
11  在 Cot_DataFactory.Handles.Sync_Empty_Ctn.Work()

这个问题,我好久之前已经问过,后来,升级了OracleClient,以为解决了,但是,最近又再次出现。

当时,只是偶尔出现,并且无法重现,而现在,已经找到了重现的办法。

具体方法,只需:

1、执行sql创建一张视图test_view。

2、执行“select * from test_view",转存入datatable中。

3、执行sql为test_view新增或减少字段。

4、执行"select * from test_view“,转存入datatable,此处,必然报错。

总结以上,也就是说,在一个程序的生命周期内,如果视图先被请求一次,之后字段有所修改,然后程序再次请求,则会报错,字段的减少与字段的增加所报的错误不一样。

目前没有找到自己的解决办法,希望大神们能指导一下。

user10931155

Best Answer

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited March 2018 Accepted Answer

    This sounds like Bug 25165860.

    Can you try turning self tuning and metadata caching off to see if the problem disappears? You set ""Self Tuning=false;Statement Cache Size=0;Metadata Pooling=false"" in the ODP.NET connection pool.

    This bug isn't a bug per se. It's a side effect of caching the metadata. If you cache the schema metadata, the expectation is that metadata is not going to be changing. If the metadata is expected to change (or possibly could change), then don't use any type of metadata nor statement caching.

    user10931155

Answers

  • 3681366
    3681366 Member Posts: 1
    edited March 2018

    Hi 3142656,

    We have the same Problem, did you find an issue ?

    Thanks

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited March 2018 Accepted Answer

    This sounds like Bug 25165860.

    Can you try turning self tuning and metadata caching off to see if the problem disappears? You set ""Self Tuning=false;Statement Cache Size=0;Metadata Pooling=false"" in the ODP.NET connection pool.

    This bug isn't a bug per se. It's a side effect of caching the metadata. If you cache the schema metadata, the expectation is that metadata is not going to be changing. If the metadata is expected to change (or possibly could change), then don't use any type of metadata nor statement caching.

    user10931155
  • user10931155
    user10931155 Member Posts: 4
    edited April 2018

    Hi,

    Thanks, it seems to work.

    Do you know if the performance could be affect with these 3 new parameters ?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited April 2018

    Performance will very likely be affected. The only question is how much. It could be minor or a little more significant. I can't determine precisely without more info about what the app is doing.

    Without statement caching, you will see more hard parses vs. soft parses. Schema metadata will need to be refetched, rather than using the local cached copy.

  • user10931155
    user10931155 Member Posts: 4
    edited April 2018

    Hi

    Thanks for your reply.

    Our application could not be stop, even when we must install a new version of our product.

    Is there a function that allow you to clear the metadata cache instead of adding new parameter in connectionstring ?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited April 2018

    You could create a new version of the app. Start it up and direct all new new users to the new version. Eventually, all active connections will drain as users complete their tasks and you can remove the old version from the midtier.

    If ODP.NET developers know they may need to change connection string settings during runtime, they can place those connection settings in a config file. When those settings are changed during runtime, a new connection pool will be created that uses the new settings and the old connection pool will eventually drain away as users log off. Just one caveat. Don't use web.config as the config file to store these pool settings since any changes during runtime will cause IIS to restart the app.

This discussion has been closed.