473,414 Members | 1,692 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,414 software developers and data experts.

Out-of-process State Management Session Cleanup

Hello,

My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.

We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.

Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?

I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.

Thanks,
Marc

Sep 11 '07 #1
5 2619
Lit
I found out in the past that whenever I have a long running process that
times-out etc... is to split it into smaller parts, organize it better and
Prioritize it.
execute/save the most critical first and then if and when possible is to
queue the rest to a back end process. Window service, Job, etc..

this may or may not help or be possible for what you are doing. It all
depends.

can you save the critical info then process? what happens if the current
user logs back on immediately.
How critical is the last log on session info to the new login session for
the same user.
Lit


<kn********@gmail.comwrote in message
news:11**********************@b32g2000prf.googlegr oups.com...
Hello,

My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.

We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.

Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?

I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.

Thanks,
Marc

Sep 11 '07 #2
the default session cleanup is a scheduled job with sqlagent. it runs at
a specified interval and just deletes expired sessions. if you look at
the proc its a pretty simple delete. you could replace it with you own
job, that the the session cleanup and ran whatever other code you want.
-- bruce (sqlwork.com)
kn********@gmail.com wrote:
Hello,

My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.

We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.

Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?

I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.

Thanks,
Marc
Sep 12 '07 #3
On Sep 11, 8:14 pm, bruce barker <nos...@nospam.comwrote:
the default session cleanup is a scheduled job with sqlagent. it runs at
a specified interval and just deletes expired sessions. if you look at
the proc its a pretty simple delete. you could replace it with you own
job, that the the session cleanup and ran whatever other code you want.

-- bruce (sqlwork.com)

knyghtf...@gmail.com wrote:
Hello,
My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.
We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.
Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?
I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.
Thanks,
Marc
Thanks for the responses, I will be looking into that right now.
Anyone else have any ideas?

Sep 12 '07 #4
Thanks for the help so far, here is some more information about the
situation that is giving us a hard time.

We have data being stored in the session that must be transmitted
externally via HTTP (Web Services Call). If the user ends the process
normally, the session-stored information can be controlled and will be
sent correctly. If the session times out, we want what has been stored
so far in the session to be sent. This is where our problem occurs.

By converting to the out-of-process state management there is no way
of .NET knowing when the the session has ended, or when the session
information is cleared. Therefore, the information that must be sent
is never sent and is lost forever.

Is there any way of alerting the .NET application that the session is
being cleared by the SQL Server (Stored Procedure)? Or are there any
other methods that are possible in this particular solution?

Keep in mind that this could be in a web farm, so there is not really
any way of knowing which process is currently in charge of the session
data.

Thanks again,
Marc
On Sep 11, 5:39 pm, knyghtf...@gmail.com wrote:
Hello,

My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.

We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.

Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?

I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.

Thanks,
Marc

Sep 12 '07 #5
Anyone have any ideas? One of the ideas that has been floating around
the office is to use an SQL Dependency to trigger a call back. Anyone
have any information about how I could go about doing this as well as
passing information back to the application?

On Sep 11, 5:39 pm, knyghtf...@gmail.com wrote:
Hello,

My company is developing a rather large application with .NET 2.0. We
are expanding to a server farm and are in the process of converting
our application to use an out-of-process session state management with
SQL Server.

We have ran into a problem with the Session_onEnd event. We know it's
not supposed to fire when in an out-of-process mode, but we have a
large amount of code that must be executed to clean the session and to
log some critical data.

Are there any best practises for dealing with such a situation? What
have others done in the past that have helped them keep a session
state that times-out and cleans up afterwards? Is there a possibility
of the SQL Server to keep track of said timeout and execute some clean
up code?

I've been searching for a few days now and have not yet been able to
find any "best practises" for this type of situation, if you know of
any articles, or have any personal experience, any help is
appreciated.

Thanks,
Marc

Sep 19 '07 #6

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

Similar topics

4
by: FilexBB | last post by:
Hi Folks, I have tried to redirect system.out for a while and then set it back, but it can't set it back as following program snapshot ByteArrayOutputStream baos = new ByteArrayOutputStream();...
4
by: Merlin | last post by:
Hi there, I would like to check if a string is a valid zip code via Javascript. Length and existents are already checked. How can I find out if the string contains characters other than...
5
by: Mike Carroll | last post by:
I have a COM server that's generally working ok. But one of its methods, when the IDL gets read by the Intertop layer, has parameters of type "out object". The C# compiler tells me that it...
4
by: Steve B. | last post by:
Hello I'm wondering what is exactly the difference between "ref" and "out" keywords. Thanks, Steve
2
by: Chua Wen Ching | last post by:
Hi there, I am wondering the difference between attribute and out keywords. Are they the same or does it serve any different purposes? I saw the and out usage in this code, and i had idea,...
4
by: Jon | last post by:
Why are out parmeters included in an BeginInvoke? They seem to do nothing? TestProgam: using System; namespace TempConsole { class App { public delegate void MyDelegate( out byte b, out...
14
by: stic | last post by:
Hi, I'm in a middle of writing something like 'exception handler wraper' for a set of different methodes. The case is that I have ca. 40 methods form web servicem, with different return values...
4
by: dlgproc | last post by:
I have a managed C++ DLL that contains the following: MyLib.h: // MyLib.h #pragma once using namespace System; using namespace System::Runtime::InteropServices; namespace MyLib { public...
6
by: nick | last post by:
For example: public static void FillRow(Object obj, out SqlDateTime timeWritten, out SqlChars message, out SqlChars category, out long instanceId)
6
by: selva | last post by:
hi, currently iam working on c# i need to pass a parameter inside a function which is a OUT parameter and i need to pass it as a reference how to do this? please help me regarding this...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.