473,804 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Whats the best way for a thread to update session information?

I'm developing a website which at one point has a hefty amount of data
processing to do. I delegate this to a separate thread and on the results
page do an auto-refresh every few seconds until the results are available.

In my thread I take a reference to the page that invoked the thread, so that
I can get access to the session object. The thread writes to the session to
indicate that it has finished. This all worked fine, until I decided to
switch from InProc to StateServer. Whilst I don't get any errors, it behaves
as though the session object my thread is referencing is different to the
one that my results page is referencing and my communications therefore
don't work any more.

So, my question is, what is the best way for a thread to get access to the
current session object?

(I'm sure it should be sooo easy but ....)

thanks in advance,

Brian.
Nov 21 '05 #1
4 1041
Brian,

I am not sure if I understand you, however if I do.

I don't see the sence of what you are doing, you are creating probably a
bunch of overhead to tell the client that he has to watch what is mostly
done by a WaitCursor.

However your pages are stateless, which means that as soon that you do the
sent, the page is gone out of memory, with all that belongs to him except
the session information, his extra threads are left alone.

Maybe can you do what you want by creating an extra windowservice or
webservice which than can return the information because of a session.id

As I said, be aware that you are creating a bunch of overhead, where your
user has to wait for. A webserver is not a one to one operating process, it
should be able to handle an enormous amount of clients.

I hope this gives some idea's,

Cor
Nov 21 '05 #2
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:OY******** ******@TK2MSFTN GP10.phx.gbl...
Brian,

I am not sure if I understand you, however if I do.

I don't see the sence of what you are doing, you are creating probably a
bunch of overhead to tell the client that he has to watch what is mostly
done by a WaitCursor.

However your pages are stateless, which means that as soon that you do the
sent, the page is gone out of memory, with all that belongs to him except
the session information, his extra threads are left alone.

Maybe can you do what you want by creating an extra windowservice or
webservice which than can return the information because of a session.id

As I said, be aware that you are creating a bunch of overhead, where your
user has to wait for. A webserver is not a one to one operating process,
it should be able to handle an enormous amount of clients.

I hope this gives some idea's,

Cor


I don't mean to appear dense, but how does one implement a WaitCursor for a
web page? I've only seen it used on desktop applications (where session
isn't an issue anyway).

thanks,

Brian.
Nov 21 '05 #3
Brian,

AFAIK is in in most cases (there are exceptions) in ASPNET automatic when
the page is waiting for a postback.

Cor
Nov 21 '05 #4
"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:OS******** ******@TK2MSFTN GP09.phx.gbl...
Brian,

AFAIK is in in most cases (there are exceptions) in ASPNET automatic when
the page is waiting for a postback.

Cor


Never seen it, and I don't want to risk the browser timing out.
Nov 21 '05 #5

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

Similar topics

15
7674
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not there at all? Any feedback would be helpful. Thanks! -Josh
0
1435
by: R. Rajesh Jeba Anbiah | last post by:
----------------------------------------------------------------- This is the FAQ thread where the FAQ compilation project goes. * If you wish to improve the contents, please copy the whole content, fix it and then post it. When posting, please change the revision number (increase by 1) in the subject line. * If you want to comment, do it without changing the subject line. * Do NOT add new question and answers here. Add here *only* after...
6
2329
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something more sophisticated), and what situations might perturb it. Even a hint as to what would be considered normal scheduling might help. The root of our problem is that we observed a normally well-behaved web application suddenly limit itself to a...
2
2264
by: Stephen Brown | last post by:
We've been using dotNet for a couple of years now and have been updating our live server by just overwriting (Explorer drag and drop) the aspx and assembly files until we had some errors reported to us a couple of months ago that some clients received application server errors at the moment we updated (if I remember correctly, they were sharing or process in use errrors). Since then, we've been paranoid about ensuring that there is no...
5
1300
by: Rudy | last post by:
Hello! I currently have a site online. I added more features to my datagrid page, so users can update and stuff. I though I could just copy the aspx, aspx.vb and the server page including the web config, and paste then on the server. At c:\intepub\wwwroot\website. But now I get a runtime error when I go to that page. What is the best way to update a site after maiking modifications on the developer machine? TIA
2
1717
by: anassar | last post by:
I have an ASP.Net Web Application where I depended on Sessions to share information across the code. One of the buttons the user clicked, take a long time to process. So, I started multi-threading the function behind that button, but then I hit a brick wall - the new thread has no access to Context.Current and therefore cannot see the Session variables. I understand why threads should not depend on Context.Current as they can outlive...
4
4243
by: Diffident | last post by:
Hi All, I am trying to perform a non-CPU bound operation in an asynchronous fashion using 'Thread' and a delegate. Basically, I am spawning a thread using ThreadStart and Thread. My non-CPU bound operation needs to have access to Session variables; Even though I embedded the state information (which also includes the context object) in an object and passed the object to the Thread , I am unable to access the Session variables. The...
6
3144
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it to the client. Before adding data to the arraylist, I check if the depth of the arraylist is longer than iMaxQueueDepth, and if it is, I clear the arraylist. Is it possible that while I am clearing the arraylist, the ThreadMain at the same time...
2
2642
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10329
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9163
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7626
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.