Kendo UI generated SQL queries with nHibernate

2 posts, 0 answers
  1. Ilkka
    Ilkka avatar
    3 posts
    Member since:
    May 2013

    Posted 09 Jul 2013 Link to this post


    I am using nHibernate as ORM and showing data to user with Kendo UI. I am retrieing data with nHibernate Query interface and then constructing Kendo UI DataSourceResult.

    However I noticed quite strange thing when I observed the SQL queries that Kendo UI + nHibernate combination generates. It seems that for each data fetching two queries are made.

    The first query simply queries how many rows the query will return. The second query fetches the actual data, but limits the results with SQL TOP keyword.

    My question is that is this intended behavior? Can it be bypassed somehow?

    / IlkkaH
  2. Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 11 Jul 2013 Link to this post


     Yes, this is the expected behavior. The first query is needed to get the total number of records. The second query retrieves the first page of the records.

    Atanas Korchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top