LLBL (2.5 final) and Telerik RadGrid

Posts   
 
    
daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 16-Apr-2008 16:21:15   

Hello

Just a quick question - has anyone had any experience with using the two together?

It seems to run REALLY slowly for me on relatively small tables of data (100 records).

Many thanks

Darren

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 16-Apr-2008 17:57:53   

What exactly are you displaying in the grid? Fields from the same entity, or fields from differnet entities.

Since you are using SelfServicing, you might be triggering LazyLoading if you're displaying fields from related entites, so you'd better use a prefetchPath.

howez
User
Posts: 28
Joined: 12-May-2007
# Posted on: 16-Apr-2008 22:18:01   

We are using a TypedList and the Component Art Grid. It is wicked fast. I can send you a code snippet if interested..

Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 17-Apr-2008 00:18:05   

Nah ... you should be good. You wanna post your code and I'll take a look.

Cheers,

Pete

daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 17-Apr-2008 09:46:06   

A mixture in different areas Walaa but what you guys are saying about the Lazy Loading and Pre-fetched paths sounds like it might be where the problem is coming from as I'm not doing anything in these areas.

Any pointers / code snippets would be a great help.

Many thanks smile

Darren

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 17-Apr-2008 10:33:25   

For example if you are fetching EntityCollection of Orders. And you are displaying some fields from the orders table, but you also are displaying Order.Customer.LastName for example, this will trigger LazyLoading, which means for each row of the fetched Orders entity, a separate fetch call will be made to the database to get all the customer's entity fields just to display the Customer.LastName

This also is true for each field you display form other related entities.

Here are some tips:

1- If the Grid will be read only, use a TypedList or a DynamicList.

2- If not, then use prefetchPaths in the fetch method to fetch related entities as well, this will issue one database call to fetch all customers for all orders, and hence will disable LazyLoading.

3- You can specify excludedIncludedFields list to execlude fields from being fetched. this is also true in the prefetched related entities.

daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 17-Apr-2008 10:41:19   

That's great - fortunately I am in the process of re-writing one of the applications I have had a problem with so I can try some of these out.

If I am using the LLBL Data Source I am presuming I can do something like:

LLBLDataSource1.PrefetchPathsToUse = _paths;

Thanks for your help simple_smile

Darren

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 17-Apr-2008 11:07:30   

If I am using the LLBL Data Source I am presuming I can do something like:

LLBLDataSource1.PrefetchPathsToUse = _paths;

Yes you can.

daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 17-Apr-2008 15:31:10   

Walaa do you have an example of using a typed list with a data source please?

I'm struggling to find one.

Thanks

Darren

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 17-Apr-2008 16:00:27   

Walaa do you have an example of using a typed list with a data source please?

I'm struggling to find one.

I don't at the moment, but I can create one for you (using LLBLGen v.2.5) if you want.

But it's very easy, just follow the folowing steps:

1- Create a TypedList in LLBLgen Pro Designer (make sure you select the required fields from the entities envolved).

2- Generate the code.

3- On a Web Form, drop a GridView, and an LLBLGenProDataSource (LLBLGenProDataSource2 if you are using the Adapter model)

4- Configure the LLBLGenProDataSource using the smart tagto use your newly created TypeList.

5- Build and run.

daz_oldham avatar
daz_oldham
User
Posts: 62
Joined: 20-Jul-2007
# Posted on: 17-Apr-2008 19:32:04   

Ah so I'm going to be hard-coding a view into the DLL.

The lightbulb above my head has lit up and now I can see so many benefits simple_smile

Thanks smile