When to unload Session obejects

Discussion in 'ASP .Net' started by jorge, May 25, 2004.

  1. jorge

    jorge Guest

    Hi all,

    When should I remove objects that I have put in my session. The consumer of
    the control does not know anything about the control. I HAVE to put this
    guys in the session.

    Also,
    I need to know if a Button.Click event has been fired BEFORE a
    TextBox.TextChanged event gets fired. Which is not the way it works right
    now. (The control is a Composite control)

    / jorge
     
    jorge, May 25, 2004
    #1
    1. Advertising

  2. jorge

    Scott Allen Guest

    Ideally, the runtime will remove objects from the session after the
    session times out (if it times out), and the objects are garbage
    collected. You really can't be proactive about it, particularly from
    the persepctive of a control author.

    --
    Scott
    http://www.OdeToCode.com

    On Tue, 25 May 2004 17:14:00 +0100, "jorge"
    <> wrote:

    >Hi all,
    >
    >When should I remove objects that I have put in my session. The consumer of
    >the control does not know anything about the control. I HAVE to put this
    >guys in the session.
    >
    >Also,
    >I need to know if a Button.Click event has been fired BEFORE a
    >TextBox.TextChanged event gets fired. Which is not the way it works right
    >now. (The control is a Composite control)
    >
    >/ jorge
    >
     
    Scott Allen, May 25, 2004
    #2
    1. Advertising

  3. jorge

    jorge Guest

    Ack! The event mechanism of ASP.NET should change. Any extensions to the
    framework that are worth looking at?

    / jorge

    "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
    news:...
    > Ideally, the runtime will remove objects from the session after the
    > session times out (if it times out), and the objects are garbage
    > collected. You really can't be proactive about it, particularly from
    > the persepctive of a control author.
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Tue, 25 May 2004 17:14:00 +0100, "jorge"
    > <> wrote:
    >
    > >Hi all,
    > >
    > >When should I remove objects that I have put in my session. The consumer

    of
    > >the control does not know anything about the control. I HAVE to put this
    > >guys in the session.
    > >
    > >Also,
    > >I need to know if a Button.Click event has been fired BEFORE a
    > >TextBox.TextChanged event gets fired. Which is not the way it works right
    > >now. (The control is a Composite control)
    > >
    > >/ jorge
    > >

    >
     
    jorge, May 25, 2004
    #3
  4. "jorge" <> wrote in message
    news:...
    > Ack! The event mechanism of ASP.NET should change. Any extensions to the
    > framework that are worth looking at?


    Why do you need your Session objects removed sooner?

    You could handle the Session_End event in global.asax and remove things at
    that time. I suggested to another poster that he try iterating through
    Session, checking each object to see if it implements IDisposable, and
    calling IDisposable.Dispose() on it if it does. Maybe that will help you.
    --
    John Saunders
    johnwsaundersiii at hotmail


    > "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
    > news:...
    > > Ideally, the runtime will remove objects from the session after the
    > > session times out (if it times out), and the objects are garbage
    > > collected. You really can't be proactive about it, particularly from
    > > the persepctive of a control author.
    > >
    > > --
    > > Scott
    > > http://www.OdeToCode.com
    > >
    > > On Tue, 25 May 2004 17:14:00 +0100, "jorge"
    > > <> wrote:
    > >
    > > >Hi all,
    > > >
    > > >When should I remove objects that I have put in my session. The

    consumer
    > of
    > > >the control does not know anything about the control. I HAVE to put

    this
    > > >guys in the session.
    > > >
    > > >Also,
    > > >I need to know if a Button.Click event has been fired BEFORE a
    > > >TextBox.TextChanged event gets fired. Which is not the way it works

    right
    > > >now. (The control is a Composite control)
    > > >
    > > >/ jorge
    > > >

    > >

    >
    >
     
    John Saunders, May 25, 2004
    #4
  5. First, stop posting this to so many groups.

    Session times out automatically, you do not need to explicitly remove them.
    If you are trying to be efficient with memory, set the session expiration
    lean. The default is 20 minutes.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "jorge" <> wrote in message
    news:O$h%...
    > Hi all,
    >
    > When should I remove objects that I have put in my session. The consumer
    > of
    > the control does not know anything about the control. I HAVE to put this
    > guys in the session.
    >
    > Also,
    > I need to know if a Button.Click event has been fired BEFORE a
    > TextBox.TextChanged event gets fired. Which is not the way it works right
    > now. (The control is a Composite control)
    >
    > / jorge
    >
    >
     
    Alvin Bruney [MVP], May 27, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ABC
    Replies:
    2
    Views:
    876
    Spam Catcher
    Dec 20, 2005
  2. =?Utf-8?B?Q2hyaXM=?=

    w3wp.exe Crash, Session Unload, Event ID 1000

    =?Utf-8?B?Q2hyaXM=?=, Dec 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    9,384
    =?Utf-8?B?c3RpbmU=?=
    Mar 5, 2006
  3. jorge

    When to unload Session obejects

    jorge, May 25, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    128
    jorge
    May 25, 2004
  4. jorge

    When to unload Session obejects

    jorge, May 25, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    135
    Alvin Bruney [MVP]
    May 27, 2004
  5. jorge

    When to unload Session obejects

    jorge, May 25, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    119
    Alvin Bruney [MVP]
    May 27, 2004
Loading...

Share This Page