 |
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0  | This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

October 13th, 2009, 02:23 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
I donât think we save any process time ifâ¦
hi
Page 257:
âThe user's location is not retrieved directly from her profile in the preceding code because that would cause a read for each and every row. Insteaad, the user's country, state, and city are read only once from the profile and saved in local variables.â
a) Profile for current user is retrieved from the DB the first time Profile object is accessed, but from that point onward, you can read it without any DB work. So I donât see how process time is saved if we save userâs location in local variables?!
thanx
|
|

October 13th, 2009, 06:25 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
Quote:
Originally Posted by carewithl
hi
Profile for current user is retrieved from the DB the first time Profile object is accessed,
|
Where are you getting this information? To my knowledge, the ASP.NET runtime does not cache the Profile data.
|
|
The Following User Says Thank You to Lee Dumond For This Useful Post:
|
|
|

October 14th, 2009, 01:25 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Lee Dumond
Where are you getting this information? To my knowledge, the ASP.NET runtime does not cache the Profile data.
|
Itâs from book Pro Asp.Net 3.5 iin C# 2008.:
âThe first time you access Profile object in your code, Asp.Net retrieves the complete profile data for current user from the DB. From this point onward, you can read the profile information in your code without any further database work(until the next postback)â
Anyways, I didnât say Asp.Net saves profile data for current user across postbacks, but it does save it during the processing of the current request, while author implies that even during the processing of the current request the profile data for current user is retrieved every time we access Profile property
|
|

October 14th, 2009, 01:39 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
Who's book is that?
I still don't think that's correct. As far as I know, profile properties are retrieved one at a time as they are called.
This is actually MORE efficient that retrieving the entire Profile object in most cases.
Maybe that author is misinformed. Or maybe I am, but I don't think so.
Last edited by Lee Dumond; October 14th, 2009 at 01:41 PM..
|
|
The Following User Says Thank You to Lee Dumond For This Useful Post:
|
|
|

October 16th, 2009, 02:46 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
hi
Quote:
Originally Posted by Lee Dumond
Who's book is that?
|
It’s by Mathew MacDonald.
Quote:
Originally Posted by Lee Dumond
I still don't think that's correct. As far as I know, profile properties are retrieved one at a time as they are called.
|
You mean that particular profile property for current user is retrieved from DB each time it is called, OR just once ( and then it is saved for the duration of current request )?
But even if individual profile property for current user are retrieved the first time it is called ( and then it's saved for the duration of the current request ), then author is still wrong, since calling user’s location directly from profile for each and every row wouldn’t have cause “read ( from DB ) for each and every row” and thus we don’t save any process time if we save user’s location in local variables
cheers mate
|
|

October 16th, 2009, 03:05 PM
|
 |
Wrox Author
|
|
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
|
|
No, what I am saying is that the data is retrieved from the DB each time a property is accessed. There is no mechanism that I'm aware of that saves it as part of the current request. This means that if you are accessing the data repeatedly (as part of a loop for example), a fetch to the DB takes place for each pass.
This is because the ProfileCommon class fetches property values by calling the GetPropertyValue method, and then casting to the type of the property. The GetPropertyValue method invokes the aspnet_Profile_GetProperties stored procedure in the database.
Also, the ProfileCommon class does not cache the values as they are retrieved.
|
|
The Following User Says Thank You to Lee Dumond For This Useful Post:
|
|
|

October 21st, 2009, 02:57 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 32
Thanks: 17
Thanked 0 Times in 0 Posts
|
|
I apologize for not replying sooner, but my PC was in repair
Anyways, thanx for helping me out
cheers
|
|
 |