Sql session state

S

SteveSu

Hi!
I have a few question regarding sql session state.

Is the database hited only ones when the session is created and then no
database hit until session expires or is there a database hit every
time a new page is rendered like when using profiles? If the database
is only hitted when creating the session then how is the data saved
while the session is "living"?
I want to use sql state cause´ my site will be hosted by a webfarm
with mutiple iis using loadbalancing.

Thanks in advance
/ Stefan
 
K

Karl Seguin

I do believe that it'll serialize to the database (hit) every time new data
is stored or retrieved from the session object. At the very least, it'll
happen once per page.

You know, the simplest answer to your question is to simply turn on SQL
Profiler and see what kind of activity you get. You seem to be asking out
of performance concerns, that'll tell you much more than the collective
knowledge here :)

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!



Hi!
I have a few question regarding sql session state.

Is the database hited only ones when the session is created and then no
database hit until session expires or is there a database hit every
time a new page is rendered like when using profiles? If the database
is only hitted when creating the session then how is the data saved
while the session is "living"?
I want to use sql state cause´ my site will be hosted by a webfarm
with mutiple iis using loadbalancing.

Thanks in advance
/ Stefan
 
M

Max

The DB will be hit with every page. In terms of performance this sounds
worse than it actually is from my experience.

If you are on a webfarm you won't have much choice anyway.

Hans
 
B

Brock Allen

Another approach is to not use SessionState, and instead use the data Cache
to do lazy loads of the data you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,093
Latest member
Vinaykumarnevatia00

Latest Threads

Top