Print Page | Close Window

GetEntitiesAsync Hangs

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1186
Printed Date: 12-Mar-2025 at 7:02pm


Topic: GetEntitiesAsync Hangs
Posted By: *Calsy
Subject: GetEntitiesAsync Hangs
Date Posted: 01-Apr-2009 at 10:12pm
Hi All, Another performance question. We have some large dropdowns in some our forms so I decided that when hte application kicks off we would get the entities required for the dropdown async so that when the form loads it doesnt have to hit the db for the records. Sounds pretty simple.

The problem is that once the GetEntitiesAsync finishes pulling the data across it seems to hang the UI for a second or two (on the big datasets). Can you please explain why this is or what we can do to get around it.

Thanks in advance



Replies:
Posted By: kimj
Date Posted: 02-Apr-2009 at 7:52pm
We haven't specifically seen GetEntitiesAsync hanging, but I can think of a reason why that might occur.  The async portion of the call will retrieve the data from the backend, but all post-processing of that data to merge it into the PM cache is done on the main thread (because the PM is not thread safe). 
 
I don't really know what's causing the slowdown in your particular case, but if the problem seems to be large amounts of data returned then breaking the query up into smaller chunks might work, and you could run each of these async queries in parallel.
 
Other things to look at would be any event handlers on the EntityTable(s) involved and turning those handlers off during the merge; any other handlers for list or property changed events, and turning those off.
 
 



Print Page | Close Window