DataAdapter.fill throwing an "Index out of range error"

D

dalaeth

I have searched Google high and low and haven't found anything that
works. Here's my problem, hopefully someone will be able to help!

I'm using 1.1 Framework, and ODP.NET 9.5.0.7 on a Windows 2003 Server.

I have a cached DataSet that I fill using an OracleDataAdapter. Changes
are made to that dataset in memory and as rows are changed, they are
updated back to the database using OracleDataAdapter.Update(DataRow).

Every few minutes, I refresh the cached queue from the database by
calling a subsequent OracleDataAdapter.Fill(). Most of the time, this
works fine. Occasionally - and I have not been able to pinpoint the
conditions when it happens - the fill command will hang.

It gives me an Index out of Range error at:
at System.Collections.ArrayList.get_Item(Int32 index)
at System.Data.DataTable.RecordStateChanged(Int32 record1,
DataViewRowState oldState1, DataViewRowState newState1, Int32 record2,
DataViewRowState oldState2, DataViewRowState newState2)
at System.Data.DataTable.SetOldRecord(DataRow row, Int32
proposedRecord)
at System.Data.DataTable.CommitRow(DataRow row)
at System.Data.DataTable.LoadDataRow(Object[] values, Boolean
fAcceptChanges)
at System.Data.Common.SchemaMapping.LoadDataRow(Boolean
clearDataValues, Boolean acceptChanges)
at System.Data.Common.DbDataAdapter.FillLoadDataRow(SchemaMapping
mapping)

The code that I am using to refresh the cached dataset is:

public static void Execute(){
try{
Log.Add("INFO", "Data Sync Start");
OracleDataAdapter dbAdapter =
(OracleDataAdapter)CachedQueue.getQueueAdapter();
dbAdapter.ContinueUpdateOnError = true;
DataSet ds = CachedQueue.getQueue();
dbAdapter.FillError += new
FillErrorEventHandler(dbAdapter_FillError);
Log.Add("DEBUG", "Filling Cached Queue");
int i = dbAdapter.Fill(ds);
Log.Add("INFO", i + " items refreshed in cache");
Log.Add("INFO", "Data Sync Finish");
} catch (System.Exception e){
Log.Add("ERROR", e.StackTrace);
}
}

This is running in a Background thread. The thread itself seems to die
completely. Restarting the Application pool restarts the process and
it continues on its way until this happens again.

The dataset itself is a select from one table, with one additional
computed column added.

I would be very grateful if someone could help point me in the right
direction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top