Error with multiple LoadWith
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Error with multiple LoadWith
Hello
I just installed the new beta version (5.70.97) to test the "Cannot access a disposed object" fix.
Now i get another error with LINQ statements having more than one LoadWith() defined. This worked before with 5.40.44.
Example:
var versionTypes = from vt in PPCustomer.VersionTypes.LoadWith(i => i.VersionTypeTranslations).LoadWith(i => i.VersionOptions.LoadWith(j => j.VersionOptionTranslations))
where vt.Enabled == true
orderby vt.SortOrder
select vt;
The error:
Object reference not set to an instance of an object.
Stack:
at Devart.Data.Linq.Provider.ObjectReader`1.c()
at Devart.Data.Linq.Provider.ObjectReader`1.k()
at Devart.Data.Linq.Provider.ConnectionManager.a(IDbConnection A_0)
at Devart.Data.Linq.Provider.ConnectionManager.GetOpenConnection()
at Devart.Data.Linq.Provider.ConnectionManager.b(IConnectionUser A_0)
at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3)
at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1)
at Devart.Data.Linq.Provider.DataProvider.b.a(b A_0, Object[] A_1)
at Devart.Data.Linq.Provider.DeferredQuery`3.a(TKeyQuery A_0)
at Devart.Data.Linq.Provider.DeferredSource`2.b()
at Devart.Data.Linq.Provider.DeferredSource`2.a()
at Devart.Data.Linq.ListEnumerable`1.b()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Linq.EntitySet`1.AddRange(IEnumerable`1 collection)
at Devart.Data.Linq.Mapping.EntitySetValueAccessor`2.a(Object& A_0, Object A_1)
at Devart.Data.Linq.Provider.h.SetLinks[TEntity,TCacheEntity,TKey](TEntity obj, MetaType objMetaType, Object keySource, IList`1 linkMembers, q services, IList`1 queryLoadWith, Dictionary`2 nextLoadWiths, Boolean deferredLoadingEnabled)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Provider.JoinedEntityReader`6.c()
at Devart.Data.Linq.Provider.JoinedEntityReader`6.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Thanks for your help
________
Goddess Worship Dicussion
I just installed the new beta version (5.70.97) to test the "Cannot access a disposed object" fix.
Now i get another error with LINQ statements having more than one LoadWith() defined. This worked before with 5.40.44.
Example:
var versionTypes = from vt in PPCustomer.VersionTypes.LoadWith(i => i.VersionTypeTranslations).LoadWith(i => i.VersionOptions.LoadWith(j => j.VersionOptionTranslations))
where vt.Enabled == true
orderby vt.SortOrder
select vt;
The error:
Object reference not set to an instance of an object.
Stack:
at Devart.Data.Linq.Provider.ObjectReader`1.c()
at Devart.Data.Linq.Provider.ObjectReader`1.k()
at Devart.Data.Linq.Provider.ConnectionManager.a(IDbConnection A_0)
at Devart.Data.Linq.Provider.ConnectionManager.GetOpenConnection()
at Devart.Data.Linq.Provider.ConnectionManager.b(IConnectionUser A_0)
at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3)
at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1)
at Devart.Data.Linq.Provider.DataProvider.b.a(b A_0, Object[] A_1)
at Devart.Data.Linq.Provider.DeferredQuery`3.a(TKeyQuery A_0)
at Devart.Data.Linq.Provider.DeferredSource`2.b()
at Devart.Data.Linq.Provider.DeferredSource`2.a()
at Devart.Data.Linq.ListEnumerable`1.b()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at System.Data.Linq.EntitySet`1.AddRange(IEnumerable`1 collection)
at Devart.Data.Linq.Mapping.EntitySetValueAccessor`2.a(Object& A_0, Object A_1)
at Devart.Data.Linq.Provider.h.SetLinks[TEntity,TCacheEntity,TKey](TEntity obj, MetaType objMetaType, Object keySource, IList`1 linkMembers, q services, IList`1 queryLoadWith, Dictionary`2 nextLoadWiths, Boolean deferredLoadingEnabled)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Provider.JoinedEntityReader`6.c()
at Devart.Data.Linq.Provider.JoinedEntityReader`6.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
Thanks for your help
________
Goddess Worship Dicussion
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Hello
I just updated to the new 5.70.102 Beta.
Now I get another error when loading Data with multiple LoadWith() statements defined.
DataTableReader is invalid for current DataTable ''.
at System.Data.DataTableReader.ValidateState(String caller)
at System.Data.DataTableReader.IsDBNull(Int32 ordinal)
at Devart.Data.Linq.Provider.ObjectReader`1.CaheReader.IsDBNull(Int32 i)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Mapping.l.Accessor`2.a(T A_0)
at System.Data.Linq.Mapping.MetaAccessor`2.GetBoxedValue(Object instance)
at Devart.Data.Linq.Provider.JoinedEntityReader`6.a(f A_0)
at Devart.Data.Linq.Provider.JoinedEntityReader`6.c()
at Devart.Data.Linq.Provider.JoinedEntityReader`6.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
________
MOTORCYCLE TIRES
I just updated to the new 5.70.102 Beta.
Now I get another error when loading Data with multiple LoadWith() statements defined.
DataTableReader is invalid for current DataTable ''.
at System.Data.DataTableReader.ValidateState(String caller)
at System.Data.DataTableReader.IsDBNull(Int32 ordinal)
at Devart.Data.Linq.Provider.ObjectReader`1.CaheReader.IsDBNull(Int32 i)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Mapping.l.Accessor`2.a(T A_0)
at System.Data.Linq.Mapping.MetaAccessor`2.GetBoxedValue(Object instance)
at Devart.Data.Linq.Provider.JoinedEntityReader`6.a(f A_0)
at Devart.Data.Linq.Provider.JoinedEntityReader`6.c()
at Devart.Data.Linq.Provider.JoinedEntityReader`6.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
________
MOTORCYCLE TIRES
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Hello
Is it possible to deliver us an immediate build with this fix? This is a very urgent problem for us. There was already another LINQ2SQL issue which caused a delay on our side. Therefore we'd be very happy to get the new fix as fast as possible. Thank you very much.
Kind regards
________
Angelina jolie pictures
Is it possible to deliver us an immediate build with this fix? This is a very urgent problem for us. There was already another LINQ2SQL issue which caused a delay on our side. Therefore we'd be very happy to get the new fix as fast as possible. Thank you very much.
Kind regards
________
Angelina jolie pictures
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Hi
When do you plan to release your current build? We need it as soon as possible.
Thank you very much and best regards
________
G Engine
When do you plan to release your current build? We need it as soon as possible.
Thank you very much and best regards
________
G Engine
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Hi. Could you send me a pre-release of your build in order to be able to test the fixed feature? In case we detect other issues we could quickly report you other problems before you release this build. This will save some time.
Thank you and best regards
________
Motorcycle tires
Thank you and best regards
________
Motorcycle tires
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
Please contact us via our contact form, tell us your license number (or e-mail you used for registration). We will send our internal build to this e-mail. Also make sure that your e-mail box can receive attachments up to 10 Mb.
-
- Posts: 43
- Joined: Wed 17 Sep 2008 11:31
Hello
Thank you for the pre-release build. The problem with multiple LoadWith() is now fixed.
But I have now two other problems.
The following statement gives an error:
With local VS debugging session:
Object reference not set to an instance of an object.
at Devart.Data.Linq.Provider.ObjectReader`1.e()
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()
Deployed on Server:
Object reference not set to an instance of an object.
at Devart.Data.Linq.Provider.ObjectReader`1.e()
at Devart.Data.Linq.Provider.ObjectReader`1.Dispose()
If I change the statement and call ToList() it is working.
The other problem seems to be a multi-threading issue:
Cannot access a disposed object. Object name: 'DataContext accessed after Dispose.'.
at Devart.Data.Linq.DataContext.b()
at Devart.Data.Linq.DataContext.e()
at Devart.Data.Linq.Provider.DeferredQuery`3.a(TKeyQuery A_0)
at Devart.Data.Linq.Provider.DeferredSource`2.b()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Provider.ObjectReader`1.g()
at Devart.Data.Linq.Provider.ObjectReader`1.b()
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()
Here is the example code. This exception happens only a few times.
Thanks for your help
________
Bond Insurance Dicussion
Thank you for the pre-release build. The problem with multiple LoadWith() is now fixed.
But I have now two other problems.
The following statement gives an error:
Code: Select all
var recordSet = from m in PPCustomer.Movies
where m.AssetId == AssetId
orderby m.MovieId
select m;
foreach (var movie in recordSet)
{
...
}
Object reference not set to an instance of an object.
at Devart.Data.Linq.Provider.ObjectReader`1.e()
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()
Deployed on Server:
Object reference not set to an instance of an object.
at Devart.Data.Linq.Provider.ObjectReader`1.e()
at Devart.Data.Linq.Provider.ObjectReader`1.Dispose()
If I change the statement and call ToList() it is working.
Code: Select all
var recordSet = (from m in PPCustomer.Movies
where m.AssetId == AssetId
orderby m.MovieId
select m).ToList();
The other problem seems to be a multi-threading issue:
Cannot access a disposed object. Object name: 'DataContext accessed after Dispose.'.
at Devart.Data.Linq.DataContext.b()
at Devart.Data.Linq.DataContext.e()
at Devart.Data.Linq.Provider.DeferredQuery`3.a(TKeyQuery A_0)
at Devart.Data.Linq.Provider.DeferredSource`2.b()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at lambda_method(ExecutionScope , f )
at Devart.Data.Linq.Provider.ObjectReader`1.g()
at Devart.Data.Linq.Provider.ObjectReader`1.b()
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()
Here is the example code. This exception happens only a few times.
Code: Select all
var recordSet = (from m in PPCustomer.Mailings.LoadWith(m => m.User).LoadWith(u => u.MailingRecipients)
join u in PPCustomer.Users on m.CreatedByUserId equals u.UserId
join mr in PPCustomer.MailingRecipients on m.MailingId equals mr.MailingId
join sq in PPCustomer.Users on mr.UserId equals sq.UserId into lj
from u2 in lj.DefaultIfEmpty()
select new
{
MailingId = m.MailingId,
CreationDate = m.CreationDate,
EmailAddress = u.EmailAddress,
RecipientEmailAddresses = m.MailingRecipients.Where(mrts => mrts.MailingId == m.MailingId),
Subject = m.Subject,
State = m.Deleted ? (int)MailingState.Deleted : (m.ExpirationDate mailingListItem = new List();
foreach (var record in recordSet)
{
...
}
________
Bond Insurance Dicussion
Last edited by [email protected] on Thu 17 Feb 2011 05:24, edited 1 time in total.
I'm unable to reproduce the first problem, although I have the same build that was sent to you.
Could you please send me (supprt * devart * com, subject "LINQ foreach")
a small test project illustrating the problems?
Please attach the DDL script of the objects you are using.
As for the multithreading issue, the Devart.Data.DataContext class isn't thread safe, like the Microsoft System.Data.DataContext one.
Could you please send me (supprt * devart * com, subject "LINQ foreach")
a small test project illustrating the problems?
Please attach the DDL script of the objects you are using.
As for the multithreading issue, the Devart.Data.DataContext class isn't thread safe, like the Microsoft System.Data.DataContext one.