Page 1 of 1

Multiple query with collection

Posted: Tue 16 Mar 2010 14:27
by lsforzini
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:

Posted: Wed 17 Mar 2010 14:18
by AndreyR
Is the problem reproducible using the latest 5.60.102 build of dotConnect for Oracle?

Posted: Thu 18 Mar 2010 09:28
by lsforzini
Yes, I installed the latest release 5.60.102

Posted: Fri 19 Mar 2010 08:38
by AndreyR
The problem is fixed in the upcoming build.
We plan to release it next week.

Posted: Wed 31 Mar 2010 09:54
by lsforzini
Why the new release is delayed? When is it planned? Thanks

Posted: Wed 31 Mar 2010 15:25
by AndreyR
New build is available for download now.

Posted: Mon 05 Apr 2010 13:35
by lsforzini
The new release doesn't solves my problem. Could I send you a sample console application with the problem? Thanks

Posted: Tue 06 Apr 2010 07:37
by AndreyR
Sure you can. Send it to support * devart * com. Please include a link to this post into the e-mail.

Posted: Tue 25 May 2010 20:01
by vargavik
I have the same issue, please let me know if there is any solution.

Posted: Thu 27 May 2010 13:59
by AndreyR
We are working on this situation. Unfortunately, we don't have any timeframe concerning this functionality implementation.