Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

TobselJan 27 2025

Hello,

we changed the Oracle.ManagedDataAccess.Core Version from 23.5 to 23.7. After that we get the following exception with executing the following select using OracleDataAdapter: “select * from sivas_kunden” (table has 362 records)

For reducing the roundtrips the FetchSize in the OracleCommand is set to the value 28409760.

Database Version is:

19.25.0.0.0

Tracing looks like that:

2025-01-27 11:37:40.258706 TID:1   (NET) (REC) (CID1) ReaderStream.ProcessHeaderData() Recv length:OB.DAFlags:DAFlags 120:0:0
2025-01-27 11:37:40.258716 TID:1   (NET) (REC) (CID1) ReaderStream.ProcessHeaderData() Recv ret length:OB.DAFlags:DAFlags 120:0:0
2025-01-27 11:37:40.258726 TID:1   (PRI) (TTC) (CID2) OraBufReader.GetDataFromNetwork(): Data Length Read From Network: 110
2025-01-27 11:37:40.258739 TID:1   (PRI) (TTC) (ENT) (CID2) TTCError.ReadWarning()
2025-01-27 11:37:40.258755 TID:1   (PRI) (TTC) (EXT) (CID2) TTCError.ReadErrorMessage()
2025-01-27 11:37:40.258894 TID:1   (PRI) (ENT) OracleException.HandleError() from TTCExecuteSql.ReceiveExecuteResponse()
2025-01-27 11:37:40.258996 TID:1   (PRI) (TTC) (ERR) OracleException.HandleError() from TTCExecuteSql.ReceiveExecuteResponse()(txnid=n/a) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(Accessor[] bindAccessors, Boolean bHasReturningParams, SqlStatementType statementType, Int64 noOfRowsFetchedLastTime, Int64 noOfRowsToFetch, Int32 longFetchSize, Int64 clientInitialLOBFetchSize, Int64 initialLOBFetchSize, Int64 initialJSONFetchSize, Int64[] scnFromExecution, Boolean bAllInputBinds, Int32 arrayBindCount, Boolean bDefineDone, RER_RefAndOutParamArgCtx refOutArgCtx, Boolean bReadSqlId, Boolean bLOBArrayFetchRequired, Boolean bAsync)
2025-01-27 11:37:40.259017 TID:1   (PRI) (EXT) OracleException.HandleError() from TTCExecuteSql.ReceiveExecuteResponse()
2025-01-27 11:37:40.259200 TID:1   (PRI) (TTC) (EXT) (CID2) TTCExecuteSql.ReceiveExecuteResponse()
2025-01-27 11:37:40.259370 TID:1   (PRI) (ENT) (CID2) OracleException.HandleError() from OracleDataReaderImpl.FetchMoreRows()
2025-01-27 11:37:40.259438 TID:1   (PRI) (SVC) (ERR) (CID2) OracleException.HandleError() from OracleDataReaderImpl.FetchMoreRows()(txnid=n/a) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(Accessor[] bindAccessors, Boolean bHasReturningParams, SqlStatementType statementType, Int64 noOfRowsFetchedLastTime, Int64 noOfRowsToFetch, Int32 longFetchSize, Int64 clientInitialLOBFetchSize, Int64 initialLOBFetchSize, Int64 initialJSONFetchSize, Int64[] scnFromExecution, Boolean bAllInputBinds, Int32 arrayBindCount, Boolean bDefineDone, RER_RefAndOutParamArgCtx refOutArgCtx, Boolean bReadSqlId, Boolean bLOBArrayFetchRequired, Boolean bAsync)
   at OracleInternal.ServiceObjects.OracleDataReaderImpl.FetchMoreRows(Int64 noOfRowsToFetch, Boolean fillReader, Boolean returnPSTypes, Boolean bAsync)
2025-01-27 11:37:40.259460 TID:1   (PRI) (EXT) (CID2) OracleException.HandleError() from OracleDataReaderImpl.FetchMoreRows()
2025-01-27 11:37:40.259639 TID:1   (PRI) (SVC) (EXT) (CID2) OracleDataReaderImpl.FetchMoreRows()
2025-01-27 11:37:40.259835 TID:1   (PUB) (EXT) (CID2) OracleDataReader.ReadInternal()
2025-01-27 11:37:40.260517 TID:1   (PUB) (EXT) (CID2) OracleDataReader.Read()
2025-01-27 11:37:40.260586 TID:1   (PRI) (EXT) (CID2) OracleDataAdapter.Fill()

The error does not occur in version 23.5 and not if I do not set the FetchSize.

What can be the root of that problem?

Thank you very much,

Tobias

Comments

Post Details

Added on Jan 27 2025
7 comments
131 views