I have a process that manages a list of trades. Each trade is a separate row in the table. I blast the process with 10,000 new trades in order to stress test it and end up with the below listed exception when I call the NewRow method. The number of times it happens is NOT consistent (sometimes a few times out of 10,000 and sometimes 1000+ times). The app is written in VB and I am using SyncLock everywhere the table is accessed but I am sure it is still some concurrency issue.
Code ==>
' create new execution row
SyncLock _executionMonit or
exec = _tradeTable.New Row
End SyncLock
Execption ==>
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index) ( at System.Collecti ons.ArrayList.g et_Item(Int32 index)
at System.Data.Rec ordManager.NewR ecordBase()
at System.Data.Dat aTable.NewRecor d(Int32 sourceRecord)
at System.Data.Dat aTable.NewRow(I nt32 record)
at System.Data.Dat aTable.NewRow()
at LaBranche.Barra cuda.TradeManag er.OnEntryMessa geReceived(Obje ct sender, MessageEventArg s e))
Any thoughts are appreciated. Thanks.
- Jason