A
Al Cohen
We've got a few methods that take a long time to complete. We're in the
process of starting to launch these as separate threads, and having the
web form refresh every few seconds to report the method's progress.
Communication between "new" thread and web page is via the Session
object. (Not rocket science so far.)
The first problem that we ran into was that our methods could not see
the Session object anymore once they were placed in a seperate thread.
After Googling for a fix, we remedied this by passing a Session
reference to the methods that we need to use. This was somewhat of a
pain as we had to rewrite a library to take the Session reference as a
parameter. But it works.
Now we're finding that we also cannot see the Application object from
our newly-threaded methods. I suppose that we could pass a reference to
the Application object whenever it's needed, but this will be pretty
painful in terms of rewriting code - we have a lot of stuff cached in
the Application object.
So, my question: is there some other way that we can access the
Application from our threads that is more elegant than changing our
libraries to require a reference to be explicitly passed?
Thanks!
Al Cohen
process of starting to launch these as separate threads, and having the
web form refresh every few seconds to report the method's progress.
Communication between "new" thread and web page is via the Session
object. (Not rocket science so far.)
The first problem that we ran into was that our methods could not see
the Session object anymore once they were placed in a seperate thread.
After Googling for a fix, we remedied this by passing a Session
reference to the methods that we need to use. This was somewhat of a
pain as we had to rewrite a library to take the Session reference as a
parameter. But it works.
Now we're finding that we also cannot see the Application object from
our newly-threaded methods. I suppose that we could pass a reference to
the Application object whenever it's needed, but this will be pretty
painful in terms of rewriting code - we have a lot of stuff cached in
the Application object.
So, my question: is there some other way that we can access the
Application from our threads that is more elegant than changing our
libraries to require a reference to be explicitly passed?
Thanks!
Al Cohen