The way dataset works ???

Posts   
 
    
e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 12-Nov-2007 19:30:15   

Hi, i have a very basic question, maybe silly at that point. I have a third party grid whose datasource is a dataset that is populated by a native VS sqldataadapter. its .net 1.1, vb.net and vs2003 with mssql2000

the total number of records returned to the dataset is around 30000 and its growing. The grid has virtual load functionality where it shows 10 records at a time. But whenever this grid page is hit, the memory consumed goes up to 300mb. With the second person this becomes 500mb.

Is it because all data that the dataset gets from the server is put into the memory? and grid uses the data in memory for its paging/virtual load?

is this something about how dataset works or is it something about the grid?

any suggestions? or how could llblgen help me in this scenario? thanks

-shane

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 13-Nov-2007 09:54:59   

Looks like dataset is loaded with all rows at once and grid is doing paging over the dataset which is usually a bad idea, specially given the number of rows. If you are memory concerned (who wouldn't be given the row count) you should fetch only page at once into dataset. I don't know how your grid works but it should support this scenario. LLBLGenPro has a paging query mechanism that lets you select the page size and page number when fetching data from database, so assuming grid supports on demand loading, you would use LLBLGenPro's paging very easily - yes, LLBLGenPro will help you a lot.

e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 13-Nov-2007 13:26:44   

thanks for the post mihies, i m new to llblgen and havent gone through much.

how do you feed the dataset with llblgen? thanks -shane

mihies avatar
mihies
User
Posts: 800
Joined: 29-Jan-2006
# Posted on: 13-Nov-2007 14:02:14   

You don't actually need DataSets. Rather you will use entities (and perhaps their projections to DataTables). I wholeheartly suggest you to read the great documentation that deals will all the basic and non basic concepts of (LLBLGenPro) ORM products.

PilotBob
User
Posts: 105
Joined: 29-Jul-2005
# Posted on: 15-Nov-2007 16:58:32   

You have two options (well really more if you want to make major architectural changes) to solve this.

  1. Switch to server side paging. The grid tells you want page of data it needs and you only retrieve the subset of records needed to display.

  2. Cache the data set in the ASP.Net cache. This way, you only need to retrieve it once and will share it with all users. Depending on the tolerance for stale data you can determine how often you want to re-cache the data from the server.

BTW: Number two is actually how the SqlDataSource control in .Net 2.0 works when you turn on caching.

BOb

e106199
User
Posts: 175
Joined: 09-Sep-2006
# Posted on: 17-Nov-2007 01:01:40   

unfortunately i m kinda tied with how grid works. it does filtering where it uses the memory stored data. server side paging is not an option.

i cant do caching because every user has access to different number of records.

i think i ll try llblgen as teh datasouce and not the dataset.

thanks for the answers

-shane

PilotBob
User
Posts: 105
Joined: 29-Jul-2005
# Posted on: 21-Nov-2007 21:02:59   

e106199 wrote:

unfortunately i m kinda tied with how grid works. it does filtering where it uses the memory stored data. server side paging is not an option.

i cant do caching because every user has access to different number of records.

i think i ll try llblgen as teh datasouce and not the dataset.

thanks for the answers

-shane

Can't the cache contain all the records and do the filtering of the records you pull from the cache?

BOb