Page 1 of 1

Eager Loading

Posted: Tue 19 Nov 2013 04:25
by KiwiDev
Hi There,

I'm not sure why this works and the next piece of code doesn't.

Code: Select all

Dim LeftProducts = From c In context.Product.Include("Product").Include("Product.Category") _
Where c.x = id
 Select c
This works ok so far, but if I change it to (Adding one more level)

Code: Select all

Dim LeftProducts = From c In context.Product.Include("Product").Include("Product.Category").Include("Product.Suppliers") _
Where c.x = id
 Select c

I get the following exception:
error code: SQLiteErrorCode.Error
message: SQLite error near "(": syntax error
source: Devart.Data.SQLite
StackTrace:
at Devart.Data.SQLite.a8.a(String A_0, UInt32 A_1, String& A_2)
at Devart.Data.SQLite.bs.p()
at Devart.Data.SQLite.ag.e()
at Devart.Data.SQLite.SQLiteDataReader.c()
at Devart.Data.SQLite.SQLiteCommand.InternalExecute(CommandBehavior behavior, IDisposable statement, Int32 startRecord, Int32 maxRecords)
at Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at Devart.Data.SQLite.Entity.t.a(CommandBehavior A_0)
at Devart.Common.Entity.v.b(CommandBehavior A_0)
at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)

TargetSite:
{System.Data.Common.DbDataReader ExecuteStoreCommands(System.Data.EntityClient.EntityCommand, System.Data.CommandBehavior)}

I'd really appreciate your help. We've bought the DotConnect for SQLite license.

Thanks

Re: Eager Loading

Posted: Tue 19 Nov 2013 10:18
by MariiaI
We couldn't reproduce this issue in our environment with the latest build of dotConnect for SQLite 5.1.36. We are sending you a sample project to the e-mail address you have provided in your forum profile. Please check that the letter is not blocked by your mail filter. Please make changes to it so that the issue could be reproduced and send it back to us or send us your test project.

Re: Eager Loading

Posted: Wed 20 Nov 2013 12:08
by MariiaI
Thank you for the additional information you've provided by e-mail. We have reproduced this issue. We will investigate it and inform you about the results as soon as possible.

Re: Eager Loading

Posted: Wed 20 Nov 2013 20:02
by KiwiDev
Thanks very much.
I look forward to hearing from you guys.

Re: Eager Loading

Posted: Wed 27 Nov 2013 10:29
by MariiaI
We have investigated this issue. This is "as designed" behavior, due to the fact that in this scenario, the SQL generates with the OUTER APPLY, which is not supported in SQLite. A more detailed error message will be shown ( "OUTER APPLY is not supported by SQLite") in such cases starting from the next public build of dotConnect for SQLite.