This is a migrated thread and some comments may be shown as answers.

Fetch Plans

3 Answers 78 Views
Integration with other products
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lee
Top achievements
Rank 1
Lee asked on 08 Apr 2010, 03:44 PM
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?

3 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 12 Apr 2010, 06:24 PM
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.
0
Lee
Top achievements
Rank 1
answered on 14 Apr 2010, 01:43 PM
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?
0
Serge
Telerik team
answered on 15 Apr 2010, 12:17 PM
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.
Tags
Integration with other products
Asked by
Lee
Top achievements
Rank 1
Answers by
Serge
Telerik team
Lee
Top achievements
Rank 1
Share this question
or