W
wekrato
Hi!
I want to do a comfortable way of importing a file into my system via a
webpage.
When importing, the following three components run at the same time:
- ImportStatus which shows how far the import progress has completed so
far and offers the possibility to upload a file
- FetchImport in a second invisible frame which is loaded every few
seconds and retrieves data from the import process (percentage, error
messages,...) from the session and passes it on to ImportStatus
- ImportThread which is a seperate thread on the server, which does the
importing of the file and writes its progress into session variables
(It might be interesting to know that I access Session from within the
ImportThread via System.Web.HttpContext.Current.Session)
Now I got the following problems:
- even with every access of Session in these three components with
lock (Session.SyncRoot)
{
.... Session[...] ...
}
there are still inconsistencies. And I have no idea of how to get rid
of them.
I don't know of any other means of sharing data from one thread to
another.
Using LocalDataSlots are used to store data from a specific thread as
far as I know. I did try a little with them without success. Is there
any shared memory concept in ASP.NET that I don't know of?
- Now the ImportThread is generated in FetchImport. Since the Thread
variable is not Serializable and I use the SessionServer I cannot store
the Thread var into the Session. So at the next Postback I lose the
handle of the Thread and cannot kill it when finished. I thought about
generating the thread in ImportStatus, which is not reloaded so often.
But even if I do this, the user could close the window at any time,
without me having the chance to kill the thread.
Anyways it would be nice to have the import thread running, when I am
offline and maybe log on later and see how the import progress worked.
Is there any way to get access to a thread other than by its Thread
object? Is the data to make this happen serializable?
I have looked a lot in news groups and stuff, but did not find anything
that would make me help solve my problems.
So, does anyone give me a hint, please?
Thanks in advance.
Nice regards
Werner
I want to do a comfortable way of importing a file into my system via a
webpage.
When importing, the following three components run at the same time:
- ImportStatus which shows how far the import progress has completed so
far and offers the possibility to upload a file
- FetchImport in a second invisible frame which is loaded every few
seconds and retrieves data from the import process (percentage, error
messages,...) from the session and passes it on to ImportStatus
- ImportThread which is a seperate thread on the server, which does the
importing of the file and writes its progress into session variables
(It might be interesting to know that I access Session from within the
ImportThread via System.Web.HttpContext.Current.Session)
Now I got the following problems:
- even with every access of Session in these three components with
lock (Session.SyncRoot)
{
.... Session[...] ...
}
there are still inconsistencies. And I have no idea of how to get rid
of them.
I don't know of any other means of sharing data from one thread to
another.
Using LocalDataSlots are used to store data from a specific thread as
far as I know. I did try a little with them without success. Is there
any shared memory concept in ASP.NET that I don't know of?
- Now the ImportThread is generated in FetchImport. Since the Thread
variable is not Serializable and I use the SessionServer I cannot store
the Thread var into the Session. So at the next Postback I lose the
handle of the Thread and cannot kill it when finished. I thought about
generating the thread in ImportStatus, which is not reloaded so often.
But even if I do this, the user could close the window at any time,
without me having the chance to kill the thread.
Anyways it would be nice to have the import thread running, when I am
offline and maybe log on later and see how the import progress worked.
Is there any way to get access to a thread other than by its Thread
object? Is the data to make this happen serializable?
I have looked a lot in news groups and stuff, but did not find anything
that would make me help solve my problems.
So, does anyone give me a hint, please?
Thanks in advance.
Nice regards
Werner