Search found 4 matches

by EricDahlvang
Wed 04 Aug 2010 19:09
Forum: dotConnect for PostgreSQL
Topic: Collection was modified; enumeration operation may not execu
Replies: 4
Views: 2294

For your debugging use

Shalex wrote:make sure that the same connection object in your code is not used in several threads simultaneously;
As I had stated in the other forum post:

"This exception occurs within the execution path of a single thread....In our current code, we create a data context at the beginning of an operation, and dispose of it when we commit the transaction. We create and destroy multiple data contexts for the duration of the operation. However, we only have one active data context on a thread at any given time, and a thread only ever uses that one data context."

We had tied the data context to the thread id. I don't know how you are implementing threads in your code base, but I've wondered if this is related to some managed/unmanged thread issue. I assure you, we were only using a single data context on a thread at a time. Both the Array List exception, and the GCHandle exception were encountered in code that used one data context per thread at a time.
by EricDahlvang
Wed 04 Aug 2010 19:03
Forum: dotConnect for PostgreSQL
Topic: Collection was modified; enumeration operation may not execu
Replies: 4
Views: 2294

We have switched to another product

We have already switched to another product, and would like a refund. Here is our share-it! order number: 331150455
by EricDahlvang
Mon 02 Aug 2010 05:03
Forum: dotConnect for PostgreSQL
Topic: Collection was modified; enumeration operation may not execu
Replies: 4
Views: 2294

Collection was modified; enumeration operation may not execu

at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at Devart.Data.PostgreSql.s.a(ae A_0)
at Devart.Data.PostgreSql.ae.d(Boolean A_0)
at Devart.Data.PostgreSql.ae.h()
at Devart.Data.PostgreSql.PgSqlDataReader.Close()
at Devart.Common.DbCommandBase.ExecuteNonQuery()

Connection String=
Server=localhost;Port=5432;Pooling=True;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;Unicode=True;User Id=xxx;Password=xxx;Database=xxx

The occurrence of this exception is inconsistent. We are adding hundreds of thousands of records, and committing every 1000...closing and reopening the connection at the same time. After a couple hundred thousand, this exception will randomly occur.

We are using version 4.95.152.


I've noticed that there have been numerous bug fixes in your postgresql codebase in the past couple of months. Are you certain this is production ready?

We have been struggling with this exception and the one here: http://www.devart.com/forums/viewtopic. ... 9038#59038 (we were unable to produce a repro case, although we consistently got this in our codebase, and abandoned your linq provider because of it...moving everything into commands). Now, we are randomly getting this "collection was modified" exception.

I assure you, we are not doing anything out of the ordinary in our code. Just creating and executing commands. We do not have time to work on reproducing these errors in a side project. We are considering moving to Npgsql.

Do you have any suggestions?
by EricDahlvang
Wed 21 Jul 2010 23:28
Forum: LinqConnect (LINQ to SQL support)
Topic: System.InvalidOperationException: Handle is not initialized
Replies: 7
Views: 6884

We are also experiencing this exception

07/20/2010 16:58:55 Unhandled Exception:

Code: Select all

System.InvalidOperationException: Handle is not initialized. 
07/20/2010 16:58:55 	   at System.Runtime.InteropServices.GCHandle.get_Target() 
07/20/2010 16:58:55 	   at Devart.Data.Linq.c.i() 
07/20/2010 16:58:55 	   at Devart.Data.Linq.g.a(Int32 A_0) 
07/20/2010 16:58:55 	   at Devart.Data.Linq.e.a(a A_0) 
07/20/2010 16:58:55 	   at Devart.Data.Linq.e.a.b() 
This exception occurs within the execution path of a single thread. The answer provided by AndreyR is "Make sure you are using one DataContext object per thread" In our current code, we create a data context at the beginning of an operation, and dispose of it when we commit the transaction. We create and destroy multiple data contexts for the duration of the operation. However, we only have one active data context on a thread at any given time, and a thread only ever uses that one data context.

We have spent a significant amount of time attempting to track this down. Any assistance would be greatly appreciated.