Multiple query with collection

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
lsforzini
Posts: 14
Joined: Mon 20 Oct 2008 16:35

Multiple query with collection

Post by lsforzini » Tue 16 Mar 2010 14:27

I have this Northwind query:

var query = from o in context.ORDERS
select new myORDERS() {
ORDERID = o.ORDERID,
ORDERDETAILS = from d in o.ORDERDETAILS select new myORDERDETAILS() {
PRODUCTID=d.PRODUCTID,
},
};

where myORDERS and myORDERDETAILS are my business objects.
If I try to run the query with the Microsoft provider for Sql Server System.Data.SqlClient in sql monitor I have the current query:

SELECT [t0].[ORDERID], [t1].[PRODUCTID], (
SELECT COUNT(*)
FROM [dbo].[ORDERDETAILS] AS [t2]
WHERE [t2].[ORDERID] = [t0].[ORDERID]
) AS [value]
FROM [dbo].[ORDERS] AS [t0]
LEFT OUTER JOIN [dbo].[ORDERDETAILS] AS [t1] ON [t1].[ORDERID] = [t0].[ORDERID]
ORDER BY [t0].[ORDERID], [t1].[PRODUCTID]

If I run the same query with Devart driver for Oracle I obtain the following sql queries:

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11073

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11074

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11075

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11076

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 11077

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12000

SELECT t1.PRODUCTID
FROM NORTHWIND.ORDERDETAILS t1
WHERE :np0 = t1.ORDERID
np0 = 12001

This behaviour causes decrease of performance. If I not map the LINQ query in my custom objects the behaviour is the same as Microsoft driver.
Thanks :cry:

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 17 Mar 2010 14:18

Is the problem reproducible using the latest 5.60.102 build of dotConnect for Oracle?

lsforzini
Posts: 14
Joined: Mon 20 Oct 2008 16:35

Post by lsforzini » Thu 18 Mar 2010 09:28

Yes, I installed the latest release 5.60.102

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 19 Mar 2010 08:38

The problem is fixed in the upcoming build.
We plan to release it next week.

lsforzini
Posts: 14
Joined: Mon 20 Oct 2008 16:35

Post by lsforzini » Wed 31 Mar 2010 09:54

Why the new release is delayed? When is it planned? Thanks

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 31 Mar 2010 15:25

New build is available for download now.

lsforzini
Posts: 14
Joined: Mon 20 Oct 2008 16:35

Post by lsforzini » Mon 05 Apr 2010 13:35

The new release doesn't solves my problem. Could I send you a sample console application with the problem? Thanks

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 06 Apr 2010 07:37

Sure you can. Send it to support * devart * com. Please include a link to this post into the e-mail.

vargavik
Posts: 3
Joined: Tue 25 May 2010 13:33

Post by vargavik » Tue 25 May 2010 20:01

I have the same issue, please let me know if there is any solution.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 27 May 2010 13:59

We are working on this situation. Unfortunately, we don't have any timeframe concerning this functionality implementation.

Post Reply