Fetch Plans

4 posts, 0 answers
  1. Lee Weisenberger
    Lee Weisenberger avatar
    72 posts
    Member since:
    Nov 2009

    Posted 08 Apr 2010 Link to this post

    I've used the Data Services Wizard to create a Silverlight application that access data through the reverse mapping mechanism.  Everything works fine and I am able to consume the data in the Silverlight application.  The problem is that I'm transferring too much data from my tables because it is sending all of the columns whether I need the data or not.

    I'd like to only request the data columns that I need from within the tables.  It looks like utilizing Fetch Plans might do the trick but I can't figure out how to implement the Fetch Plan and access the data through the data service.  The examples that I've seen in the help section of Telerik.com aren't giving a complete enough picture to be helpful.

    Are there any complete examples or tutorials that demonstrate how to use Fetch Plans through web services utilizing ORM Reverse Mapping?
  2. Serge
    Admin
    Serge avatar
    375 posts

    Posted 12 Apr 2010 Link to this post

    Hi Lee Weisenberger,

    Unfortunately at this point you cannot use fetch plans with web services. This is due to the fact that during serialization, when a property of the object is accessed, lazy loading is triggered and the value is retrieved. 

    This means even if you implement Fetch Plans, everything will be retrieved and sent. You can of course work around this problem, but it will take some effort. The solution here is to create custom DTO object that you can manually create and populate, and send them through the service. This object can contain only the fields that you require and that way you will send only the data that you require. You will also be able to implement Fetch Plans in this scenario due to the fact that the OpenAccess persistent objects will not be serialized, but the DTO objects instead.  You can more info on the Fetch Plans find in these articles

    This way you will not trigger the lazy loading and send the correct data.

    If you need further assistance do not hesitate to ask us.

    All the best,
    Serge
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Lee Weisenberger
    Lee Weisenberger avatar
    72 posts
    Member since:
    Nov 2009

    Posted 14 Apr 2010 Link to this post

    Serge, thanks for the response.

    I think I understand what you are suggesting, but I am having problems understanding how to actually implement this.

    Do you have any examples on how to do this?
  5. Serge
    Admin
    Serge avatar
    375 posts

    Posted 15 Apr 2010 Link to this post

    Hello Lee Weisenberger,

    Unfortunately we do not have a complete example of using web services with fetch plans, we will consider it in the future. However this Northwind N-Tier example shows how to implement business objects. You can use it as a starting point and implement services and fetch plans based on it. 

    If you need further assistance, contact us back.

    Kind regards,
    Serge
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top