C# SessionState Mode SQLServer Serialization With Protobuf-net?
Feb 12, 2011
I have been thinking of ways to optimize the out of state storage of sessions within SQL server and a few I ran across are:
Disable session state on pages that do not require the session. Also, use read-only on pages that are not writing to the session.
In ASP.NET 4.0 use gzip compression option.
Try to keep the amount of data stored in the session to a minimum.
Right now, I have a single object (a class called SessionObject) stored in the session. The good news is, is that it is completely serializable.
Optimizing using protobuf-net An additional way I thought might be a good way to optimize the storage of sessions would be to use protocol buffers (protobuf-net) serialization/deserialization instead of the standard BinaryFormatter. I understand I could have all of my objects inherit ISerializable, but I'd like to not create DTO's or clutter up my Domain layer with serialize/deserialize logic.
View 1 Replies
Similar Messages:
Oct 25, 2010
active users on my website with sessionstate set as sqlserver.
And what if a person closes his browser then how to maintain the user count?
View 1 Replies
Apr 19, 2010
what is means of serialization mode in LINQ to SQL?
what architecture does LINQ to SQL uses internally (connected or disconnected architecture)?
View 1 Replies
Mar 16, 2011
My session variables don't get saved if the SessionState mode in the web.config file is set to StateServer. But when I changed it to InProc, then everything is fine and good. I'm trying to save a custom built object (or class) into the session after the user logs in.
View 4 Replies
Feb 13, 2011
Just wanted to know in which type of web application we can use out proc session state mode?
View 2 Replies
Aug 21, 2010
i'm interested to do the following - i geuss, i have no option to do that:
we have our "mainapplication" on a DB; we are tracking user-login status by switching a bit in the DB in the users data row.
we hvae a second application, the backend, which is the administration tool.
(the applications are put in seperate diretories on HD)
sometimes, we need to block/ban users. in some cases the users are logged in, when we "see them in action".
i'd like to build a button in the backend-application, which logss-out the user from the mainapplication.
for sure: i can access the same DB and switch the bit to "know" he's offline, but this will not kill the session on the mainapplication.
because: if a user is on/offline is also indicated by the session in the IIS. and as the IIS-session is active, the user may be already banned - but he will not be logged out automatically (and showing something like "you have been logged out because of a ban) one option would be to call the DB by each page-load to find out, if the user is logged on.
View 7 Replies
Mar 4, 2011
Is it possible to build a fully customized Session State Mode instead of using Inproc or SQLServer?
View 1 Replies
May 25, 2010
like the title shows I want to know what is the difference between "InProc" & "stateServer" mode in SessionState on ASP.NET.
View 2 Replies
Dec 12, 2010
I am new to .net 4.0 and am using EF Model and SessionState Mode=SqlServer and I am getting this error below:
Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode.
I checked the stack trace and its complaining about
[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("PoplarGroveModel", "tblMenuRole", "tblMenu", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(PoplarGroveDataModel.Menu), "tblRole",
[Code].....
I marked it as serializable but then it complains about System.Data.Objects.ObjectContext is not marked as serializable and hence throws the same error.
View 1 Replies
Nov 9, 2010
What would be the best way to detect if the SessionState has died in order to send the user to a "Session Expired" page? I've successfully configured the app (in Web.config) to do this when the authentication cookie is gone (there's a setting for that), but so far I haven't found an effective way to do something similar when the SessionState is gone. The app in question holds some data in the Session, and should present the user with a "Session Expired - login again" page if any of them is gone.
So far, the only option I can think of doing it in each of the places I access Session, but this is obviously a less than optimal solution.
View 5 Replies
Jul 7, 2010
I set ViewState["zzz"] and Session["zzz"] to the same string.
When I compare using == I get false.
When I do ViewState["zzz"].Equals(Session["zzz"]), I get true.
In the debugger, both their values show the same string, and when I do
? ViewState["zzz"] == Session["zzz"]
I get false.
I thought the ViewState StateBag Item defaults to the set value and the Session Item defaults to the value as well?
View 1 Replies
Dec 22, 2010
There is a timeout for Session object of HttpSessionState that can be set. I want to see if we can make HttpApplicationState timeout too?
View 2 Replies
Nov 26, 2010
What am I doing wrong. The sessionState Timeout never fires,It only fires after 24 hours, I want to let it fire in 20 minutes on my webpage. In the web.config I handle the sessionstate like this:
<sessionState cookieless="false" mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
timeout="1" stateNetworkTimeout="1"/>
timeout="1" is on purpose, for testing.And in the code I check on which session I am by calling Session.SessionID.ToString()
View 3 Replies
May 3, 2010
i am having problems with an asp.net c# site whereby i am setting a session state object to true and then redirecting to another page that needs to check the value of the session state object and it is null.
Sometimes it is set correctly and other times is is simply null.
When i debug on my local machine it works perfectly every time. Only when i upload to my web server does this temperamental behaviour happen.
As it is based around the security of the site it is obviously important that the session data be valid and accurate every time.
Is session state data unreliable?
AFAIK its set to inproc, cookieless, 30 min timeout, vanilla installation of IIS.
Does anyone have any suggestions? Perhaps i need to thread.sleep inbetween the storing of the session data and the reading?
NB: the time between the write and the read is about 70ms.. ample time for the data to be written to RAM.....
View 4 Replies
Feb 11, 2011
I'm managing a rather large project, written in asp.net webforms + mvc3, with a large user base, and a pretty high daily visitor count. Basically, there are a lot of requests at any given moment.
One of my controllers in MVC that handles / resizes images on the fly has the following attribute applied to it:
[SessionState(SessionStateBehavior.Disabled)]
Now, if an action in the controller tries to access the session - it obviously throws an exception - so we're good so far. The problem is: if I go to the IIS Worker Processes window (Win Server 2008 R2, IIS 7.5), and check the current requests for this site, I can sometimes see the requests to an action in this controller. Their current state is locked in State: RequestAcquireState, Module Name: Session. Sometimes these locks go over a second or two in this state.
Wasn't the whole point of the attribute in the first place to make the requests to the controller ignore the state, and not waste time (and possibly being locked) trying to acquire the state? If this is so - am I doing something wrong here, or does the problem lie elsewhere?
View 1 Replies
May 13, 2010
[Code]....
From my understanding, the asp.net 1.1 application will login the user then store the information to a session and a cookie? I'm trying to access that cookie with a asp.net 2.0 application. Is this possible?
I'm thinking the mode would need to change to maybe StateServer or Sql.
View 14 Replies
Sep 15, 2010
I got a project when after opening in visual studio 2005 in build mode drop down, only debug mode is shown but release mode not shown.Project builds successfully in debug mode is there a way to enable release mode.
View 1 Replies
Mar 7, 2011
gaining mode changing for formview in VB.The problem is that, the current mode im using was ReadOnly, and i want to add some button so thatit could connect to Edit mode in the same formview.Is it necessary to add modechanging and modechanged in the back code?
View 2 Replies
Dec 9, 2010
I'm having a problem with getting a valid Session object in the GetHttpHandler() method of a IRoutHandler. Here is my code:
[Code]....
No luck, Session is still null.
View 6 Replies
Oct 18, 2010
I am trying to config my application to use out-of-process sessionState.
<sessionstate mode="stateserver" cookieless="false" timeout="20" sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>" server="127.0.0.1" port="42424" />In my web.config I get errors for the server and port attributes, telling me that server attribute is not allowed and port attribute is not allowed.
View 2 Replies
Nov 24, 2010
In my web.config I have:
<sessionState configSource="SessionState.config">
</sessionState>
In SessionState.config I have:
<sessionState timeout="90" mode="SQLServer" allowCustomSqlDatabase="true" cookieless="false" sqlConnectionString="Data Source=.;Persist Security Info=True;Integrated Security=True">
</sessionState>
I've tried various incantations but can't seem to get it to work. I get this error:
Parser Error Message: Unable to open configSource file 'SessionState.config'.
From MSDN:
Of course they don't show an actual example.
I verified that the file is in the bin directory. I also have this working fine for the connection strings section.
How do I use a remote config file for sessionState?
View 1 Replies
Mar 17, 2011
Possible Duplicates: Debug/Release difference Performance differences between debug and release builds
What exactly is the different in compiling and running an asp.net/c# project in Debug mode VS Release Mode?
View 3 Replies
Apr 26, 2010
is it possible to use WCF classes with attributes (like [DataMember....) then you wouldnt need to do seralization on the client side (jquery) ?
View 1 Replies
Oct 16, 2010
I wanted my local iis running application to connect my database in sql authentication mode rather than windows mode,
but it is showing errors of " Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'DBUser'. ". i also ublocked port from firewall,and allowed remote connection of mssql from sql manager, enabled TCP/IP and named piped protocols from SQL surface config, and with sql manager i also changed server authentication mode to sql from windows.
my datastring is <add connectionString="Data Source=PARTHIV-PCSQLEXPRESS;Initial Catalog=aspnetdb;User ID=******;Password=******/" name="LocalSqlServer" providerName="System.Data.SqlClient" />
i made a user named DBUser in database as well i don't understand where it gone wrong ???
here is error log
[Code]....
View 4 Replies
Aug 7, 2010
can i determine programmatically if im running my web project in debug mode or compiled?
or even better if im running it on my local machine or on a server? example to change the path for databases etc..
View 7 Replies