Page 1 of 1

Another problem with Take() function

Posted: Fri 31 Jul 2009 10:04
by tompolth
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

Posted: Fri 31 Jul 2009 10:52
by tompolth
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.

Posted: Tue 04 Aug 2009 07:47
by AndreyR
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.

Posted: Tue 04 Aug 2009 08:14
by tompolth
Thank you.

Posted: Wed 23 Sep 2009 08:05
by AndreyR
We have fixed the problem. The fix will be included in the next build of dotConnect for Oracle.