New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection was modified; enumeration operation may not execute. [DNET745] #687
Comments
Modified by: @cincuranetstatus: Open [ 1 ] => In Progress [ 3 ] |
Commented by: @cincuranet Are there events used (Firebird events - post_event, etc.)? Also can they check with 5.8.1. Pieces inside this calls were bit reworked. |
Commented by: @reevespaul It looks as if the problem still exists. Here is their report... "As soon as I uncommented the query that seems to cause all the mayhem I started getting errors on the first run. 2 out of 3 runs errored and the service stopped." And some log output: -------------------------------------------------------------------------------- |
Submitted by: @reevespaul
We have a client that have found what appears to be a bug in v5.8.0.0
The code and the stack trace are attached below.
The same code works fine with all versions between 4.1 and 5.7
They've also tested with .Net framework 4 and 4.5
They are happy to run a debug build to help fix this, but have not been able to create a test case.
#if DEBUG
var cmd = "select s.S_SHOPID, s.S_VALUE as FOO, s1.S_VALUE as BAR, s2.S_VALUE as SNAFU " +
"from SYSTEMSETTING s " +
"left join SYSTEMSETTING s1 on s.S_SHOPID = s1.S_SHOPID " +
"left join SYSTEMSETTING s2 on s.S_SHOPID = s2.S_SHOPID " +
"where s.S_SYSTEM_ID = 9202 " +
"and s1.S_SYSTEM_ID = 9200 " +
"and s2.S_SYSTEM_ID = 9201 " +
"and s.S_VALUE = 'Y' " +
"and s1.S_VALUE <> '' " +
"and s2.S_VALUE <> ''";
using (FbCommand fbCmd = new FbCommand(cmd)) {
using (DataTable myDT = new DataTable()) {
using (FbDataAdapter da = new FbDataAdapter()) {
da.SelectCommand = fbCmd;
fbCmd.Connection = DbConnection;
#endif
--------------------------------------------------------------------------------
Tuesday 21 March 2017 01:20:07.308 PM
--------------------------------------------------------------------------------
:Before Select via SQL Test. Managed Thread ID: 4
:FirebirdSql.Data.FirebirdClient version: 5.8.0.0
--------------------------------------------------------------------------------
Tuesday 21 March 2017 01:20:07.308 PM
--------------------------------------------------------------------------------
:Before Data Adapter.Fill() call. Managed Thread ID: 4
--------------------------------------------------------------------------------
Tuesday 21 March 2017 01:20:07.313 PM
--------------------------------------------------------------------------------
:******--- ERROR ---******
:Managed Thread ID: 4
:Error Message: Collection was modified; enumeration operation may not execute.
:Error Message: at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
at System.Linq.Enumerable.<TakeIterator>d__24`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at FirebirdSql.Data.Client.Managed.XdrStream.Read(Byte[] buffer, Int32 offset, Int32 count) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line 249
at FirebirdSql.Data.Client.Managed.XdrStream.ReadBytes(Int32 count) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line 336
at FirebirdSql.Data.Client.Managed.XdrStream.ReadOpaque(Int32 length) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\XdrStream.cs:line 348
at FirebirdSql.Data.Client.Managed.GdsConnection.ProcessOperation(Int32 operation, XdrStream xdr) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\GdsConnection.cs:line 362
at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadSingleResponse() in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:line 638
at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse() in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:line 593
at FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadGenericResponse() in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version10\GdsDatabase.cs:line 605
at FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Prepare(String commandText) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\Client\Managed\Version11\GdsStatement.cs:line 77
at FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:line 1148
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:line 1171
at FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteReader(CommandBehavior behavior) in C:\Users\Jiri\Documents\devel\NETProvider\working\Provider\src\FirebirdSql.Data.FirebirdClient\FirebirdClient\FbCommand.cs:line 523
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at PNDataService.DbConnectionManager.InitializeEvents(String errorstatus, Boolean resumedFromDownTime) in C:\Dev VS\PNDATASERVICEVS4.5\DbConnectionManager.cs:line 987
--------------------------------------------------------------------------------
Tuesday 21 March 2017 01:20:07.329 PM
--------------------------------------------------------------------------------
:After Select via SQL Test. Managed Thread ID: 4
The text was updated successfully, but these errors were encountered: