Another problem with Take() function

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
tompolth
Posts: 6
Joined: Mon 29 Dec 2008 22:49
Location: Spain

Another problem with Take() function

Post by tompolth » Fri 31 Jul 2009 10:04

Hello again
I have detected a new anomaly with the version 5.25 of DotConnet for Oracle.
In this case the problem appears in the following code:

Code: Select all

var cons1 = cons.OrderBy("it.numInf DESC");
 var cons2 = cons1.Take(countPage);
 return cons2.ToList();
After realizing an ordination I try to take the first 100 records. Well then, in some cases it works correctly and shows the asked information, but in others it seems that the sql sentence generated is not correct and omits someone of the records without apparent reason.

For example, is indicated it that it should arrange of inverse form the records of the table and should take the first 100 and some records do not appear in the returned query.

Could it be due to a new bug?

Thanks you

tompolth
Posts: 6
Joined: Mon 29 Dec 2008 22:49
Location: Spain

Post by tompolth » Fri 31 Jul 2009 10:52

I could have verified that this behavior appears only when the function has been included in the code include ().

The complete code of my function is the following one:

Code: Select all

 public List ObtainAll(string keyOrder, string[] rutas, int indicePagina, int contadorPagina)
        {
	ObjectQuery cons = null;
	cons = CreateQuery(contexto);
	//rutas
	foreach (string cad in rutas)
	{
	        cons = cons.Include(cad);
	}
             if (clavesOrdenacion != null)
             {
           
            var cons1 = cons.OrderBy(keyOrder).Take(contadorPagina);
            
              return cons1.ToList();
            }
                
	return cons.ToList();
        }
Well then, if I comment on the line that contains the function Include () the answer is absolutely correct. That is to say, the not wished behavior is produced when the entity to consulting includes properties of navigation, as it happens in this case.

Since I have commented in another thread, these behaviors have begun to produce immediately after the installation of the version 5.25, in the previous installed version it was working quite normally.

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

Post by AndreyR » Tue 04 Aug 2009 07:47

Thank you for the report, we have already found the problem.
I will let you know about the results of our investigation.
As a workaround, try adding Skip(0) before the Take call.

tompolth
Posts: 6
Joined: Mon 29 Dec 2008 22:49
Location: Spain

Post by tompolth » Tue 04 Aug 2009 08:14

Thank you.

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

Post by AndreyR » Wed 23 Sep 2009 08:05

We have fixed the problem. The fix will be included in the next build of dotConnect for Oracle.

Post Reply