I'm developing a WCF service which imports excel files uploaded to FTP. I have an IIS FTP plugin which calls my WCF service. The service reads the file and imports its rows to PostgreSQL database. I use .net 4.5, entity framework 5, wcf, simpleinjector to accomplish this. I consume repository pattern and check wheter a record exists and if it does not I add data to repository and save, one record at a time. The entire service operation is single threaded. I use single DbContext for all import operations. DbContext lifestyle is PerWcfRequest. Every imported file consists of couple of hundred up to thousands of records.
When I upload single file everything runs fine, but when I try to upload multiple files simultaneusly, for some of them I get an exception:
Code: Select all
NotSupportedException: Specified method is not supported in Devart.Common.DbConnectionInternal.get_ServerVersionNormalized()
in Devart.Data.PostgreSql.al.u(Byte[] A_0, Int32 A_1, Int32 A_2)
in Devart.Data.PostgreSql.j.a(Byte[] A_0, Int32 A_1, Int32 A_2)
in Devart.Data.PostgreSql.al.a(Byte[] A_0, Int32 A_1, Int32 A_2)
in Devart.Data.PostgreSql.PgSqlDataReader.GetValue(Int32 i)
in Devart.Common.DbDataReaderBase.IsDBNull(Int32 ordinal)
in Devart.Common.Entity.bf.IsDBNull(Int32 ordinal)
in System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
in lambda_method(Closure , Shaper )
in System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
in lambda_method(Closure , Shaper )
in System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
in System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
in System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
in System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__2[TResult](IEnumerable`1 sequence)
in System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
in System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
in System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
in System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
I would be very grateful if You could help to debug this issue.