J
Jason Callas
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 _executionMonitor
exec = _tradeTable.NewRow
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.Collections.ArrayList.get_Item(Int32 index)
at System.Data.RecordManager.NewRecordBase()
at System.Data.DataTable.NewRecord(Int32 sourceRecord)
at System.Data.DataTable.NewRow(Int32 record)
at System.Data.DataTable.NewRow()
at LaBranche.Barracuda.TradeManager.OnEntryMessageReceived(Object sender, MessageEventArgs e))
Any thoughts are appreciated. Thanks.
- Jason
Code ==>
' create new execution row
SyncLock _executionMonitor
exec = _tradeTable.NewRow
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.Collections.ArrayList.get_Item(Int32 index)
at System.Data.RecordManager.NewRecordBase()
at System.Data.DataTable.NewRecord(Int32 sourceRecord)
at System.Data.DataTable.NewRow(Int32 record)
at System.Data.DataTable.NewRow()
at LaBranche.Barracuda.TradeManager.OnEntryMessageReceived(Object sender, MessageEventArgs e))
Any thoughts are appreciated. Thanks.
- Jason