473,433 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,433 software developers and data experts.

Session_Start infinite loop problem

Hi,
In order to keep all my properties and objects that I use in the session in
one place, I have created a class "SessionCore.cs" and on Session_Start I
create a new instance if it as follow:

Session["Core"] = new SessionCore(Session.SessionID);

The somewhere within the application for example when I need to get stored
CustomerID I use the following:

((CoreSession)Session["Core"]).CustomerID

which woks fine as long as in my Web.config I use mode="InProc"
However If I use mode="StateServer" Session_Start in Global.asax will into
infinite loop!
Does anyone know why and what the solution is please?
Thanks for your time in advance.
Kind Regards

Mehdi
Nov 19 '05 #1
2 2128
when an object is stored in a non-inporc session manager, it must be
serialized. your default serialization logic must have a loop (say two
objects point to each other, or child to parent). you will have to write a
custom serializer to get around this.

-- bruce (sqlwork.com)
"Mehdi" <no****@nospam.nowhere> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
| Hi,
|
|
| In order to keep all my properties and objects that I use in the session
in
| one place, I have created a class "SessionCore.cs" and on Session_Start I
| create a new instance if it as follow:
|
| Session["Core"] = new SessionCore(Session.SessionID);
|
| The somewhere within the application for example when I need to get stored
| CustomerID I use the following:
|
| ((CoreSession)Session["Core"]).CustomerID
|
| which woks fine as long as in my Web.config I use mode="InProc"
|
|
| However If I use mode="StateServer" Session_Start in Global.asax will into
| infinite loop!
|
|
| Does anyone know why and what the solution is please?
|
|
| Thanks for your time in advance.
|
|
| Kind Regards
|
| Mehdi
|
|
Nov 19 '05 #2
Thanks Bruce,

I put [Serializable] on top of the SessionCore class and it worked.
Regards
Mehdi
"bruce barker" <no***********@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP15.phx.gbl...
when an object is stored in a non-inporc session manager, it must be
serialized. your default serialization logic must have a loop (say two
objects point to each other, or child to parent). you will have to write a
custom serializer to get around this.

-- bruce (sqlwork.com)
"Mehdi" <no****@nospam.nowhere> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
| Hi,
|
|
| In order to keep all my properties and objects that I use in the session
in
| one place, I have created a class "SessionCore.cs" and on Session_Start
I
| create a new instance if it as follow:
|
| Session["Core"] = new SessionCore(Session.SessionID);
|
| The somewhere within the application for example when I need to get
stored
| CustomerID I use the following:
|
| ((CoreSession)Session["Core"]).CustomerID
|
| which woks fine as long as in my Web.config I use mode="InProc"
|
|
| However If I use mode="StateServer" Session_Start in Global.asax will
into
| infinite loop!
|
|
| Does anyone know why and what the solution is please?
|
|
| Thanks for your time in advance.
|
|
| Kind Regards
|
| Mehdi
|
|

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Gremlin | last post by:
If you are not familiar with the halting problem, I will not go into it in detail but it states that it is impossible to write a program that can tell if a loop is infinite or not. This is a...
5
by: mailpitches | last post by:
Hello, Is there any way to kill a Javascript infinite loop in Safari without force-quitting the browser? MP
1
by: Jim P. | last post by:
I'm having trouble returning an object from an AsyncCallback called inside a threaded infinite loop. I'm working on a Peer2Peer app that uses an AsyncCallback to rerieve the data from the remote...
5
by: Allerdyce.John | last post by:
Hi, I have this piece of code which loops thru a STL list, but that causs an infinite loop. bool Executer::group(MyList& bl, ResultList & grl) { for (ExecuterList::iterator i =...
11
by: jojobar | last post by:
I have a aspx file (snippet shown below): ======= <td class="light-m1" id="rwCompleteButton" runat="server"><br/> <asp:ImageButton CssClass="clear-m1" runat="server" CommandName="Complete"...
10
by: Steven Woody | last post by:
i have a program which always run dead after one or two days, i think somewhere a piece of the code is suspicious of involving into a infinite loop. but for some reason, it is very hard to debug....
19
by: Richard | last post by:
Hi All, I copied a script example from http://www.irt.org/script/640.htm into a local .html file. I opened that file first in HTML-kit, which hung (in an infinite loop, I think) when I...
44
by: James Watt | last post by:
can anyone tell me how to do an infinite loop in C/C++, please ? this is not a homework question .
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.