SQL Generated From LINQ Query to Telerik ORM

Thread is closed for posting
1 posts, 0 answers
  1. Gary
    Gary avatar
    2 posts
    Member since:
    May 2015

    Posted 11 Nov 2016 Link to this post

    I am experiencing some confusion on SQL generated from a fairly standard LINQ query. 

    01.var sessionQ = from sessionHdr in headersQ
    02.   join sessionBody in bodyQ on
    03.        sessionHdr.ID equals sessionBody.ID into sessionList
    04.   from sessionJSON in sessionList.DefaultIfEmpty()
    05.   where sessionHdr.Format == 13
    06. 
    07.   select new WITransmitsVP
    08.   {
    09.      ...
    10.   };

     

    Using this LINQ syntax for an OUTER JOIN I was expecting the SQL (ORACLE) generated to look something like the following ... 

    1.SELECT
    2.    ...
    3. 
    4.FROM "XFEVP"."WI_TRANSMITS_VP" a
    5.    INNER JOIN "XFEVP"."WI_TRANSMITS_VP_MSG" b ON
    6.      a."MESSAGE_ID" = b."MESSAGE_ID"
    7.WHERE a."MESSAGE_ID" = 60412762;

     

    Bun instead when I log the output I am seeing  ...

    01.SELECT
    02.    ...
    03. 
    04.FROM "XFEVP"."WI_TRANSMITS_VP" a
    05.WHERE a."MESSAGE_ID" = :p0                                      
    06.ORDER BY COL1 
    07. 
    08.SELECT
    09.    ...
    10. 
    11.FROM "XFEVP"."WI_TRANSMITS_VP_MSG" a
    12.ORDER BY COL1

     

    Two entirely separate SELECT statements. Since the second table contains MILLIONS of records the component making the call eventually crashes due to memory issues after many many minutes of latency.

     

    Why am I not getting a actual JOIN statement in the generated SQL? What's the workaround or fix?

     

    Thank You,

    Gary

     

Back to Top