Oracle.ManagedAccess.dll throw Excetpion "Index is beyond the bounds of the array" — oracle-tech

    Forum Stats

  • 3,715,657 Users
  • 2,242,821 Discussions
  • 7,845,481 Comments

Discussions

Howdy, Stranger!

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

Oracle.ManagedAccess.dll throw Excetpion "Index is beyond the bounds of the array"

2336d280-3e17-42f7-ace1-bc656e8ffe48
edited May 2018 in ODP.NET

describe problem

1. I have connected the oracle database using Oracle.managedAccess.dll(4.122.1.20180209) in application

2.I  execute sql like 'alter table con_contract add user_01 varchar2(128)' in application

3. I execut code like

dbCmd.CommandText = "select * from con_contract where 1=2";

var reader = dbCmd.ExecuteReader() // dbcmd is OracleCommand

var dt2 = reader.GetSchemaTable() // throw Exeception "Index id beyond the bounds of the array"

Thanks!

Answers

  • Mark Williams
    Mark Williams Member Posts: 67 Blue Ribbon
    edited May 2018

    Hi,

    I suspect this may be an issue with caching of metadata. There is a connection string attribute (Metadata Pooling) that defaults to True. If you are changing the table structure it is possible the metadata is stale and causing this issue. One thing you can try to help confirm this is set "Metadata Pooling=false" in your connection string. The provider is essentially not expecting changes in underlying data structures while applications are running.

    Regards,

    Mark

    Alex Keh-Oracle
This discussion has been closed.