J
Jeff
Hey
..NET 2.0
I'm developing an application which will perform some webservice calls and I
believe having those calls in a separate thread may help the app run
smoother
No user are waiting for the result of these webservice calls, Each night
this code calls some webservices, which return a result I need to store in
the database (hence I mention "_db" in the context below).
So I'm trying to figure out how to implement this, and have come across a
few issues regarding this:
PROBLEM 1:
This app has an class variable called _db, it holds a reference to the
dataset. When the app is initialized this variable is initialized too.
I created a static method which I try to access this _db variable from, but
I get an compile error because I'm trying to access the _db variable from a
static method.
I believe it's possible to create a local version of _db in the static
method. But then there will exist 2 references to the dataset and might
(AFIAK) result where one main thread reads from the table while another
thread updates the table. (dbms is sql server 2005)
PROBLEM 2:
Do you recommend me using delegate and begininvoke etc.. or create a new
thread each time this will execute - > an thread which ends when the
webservice return and database is updated?
any suggestions?
..NET 2.0
I'm developing an application which will perform some webservice calls and I
believe having those calls in a separate thread may help the app run
smoother
No user are waiting for the result of these webservice calls, Each night
this code calls some webservices, which return a result I need to store in
the database (hence I mention "_db" in the context below).
So I'm trying to figure out how to implement this, and have come across a
few issues regarding this:
PROBLEM 1:
This app has an class variable called _db, it holds a reference to the
dataset. When the app is initialized this variable is initialized too.
I created a static method which I try to access this _db variable from, but
I get an compile error because I'm trying to access the _db variable from a
static method.
I believe it's possible to create a local version of _db in the static
method. But then there will exist 2 references to the dataset and might
(AFIAK) result where one main thread reads from the table while another
thread updates the table. (dbms is sql server 2005)
PROBLEM 2:
Do you recommend me using delegate and begininvoke etc.. or create a new
thread each time this will execute - > an thread which ends when the
webservice return and database is updated?
any suggestions?