S
Sebastian Millies
Hello,
I'm writing an application that has a long-running task
which puts heavy load on the client and database. For that
reason, it needs to be suspended from time to time to
allow other work.
The long-running task is started from the GUI in a
separate thread using SwingWorker. It gets suspended
by calling a wait()/notify() from the Event-Dispatch Thread.
This works very well in a 2-tier architecture (client-database).
In a 3-tier setting, presumably the worker thread and
event thread would share a handle to a stateful session bean
on an application server. The appserver may do things like
activate/passivate/swap beans around betewenn processes,use
pooled instances, and other things I understand so poorly that
I'm perhaps not even able to phrase this intelligibly.
But can I be sure that the Thread that gets notified is
the same that was waiting, and that I'm operating
on the same bean instance? If not, do I have to forego the use
of wait() and notify() on the app server and resort to active
waiting?
Thanks for any enlightenment,
Sebastian
I'm writing an application that has a long-running task
which puts heavy load on the client and database. For that
reason, it needs to be suspended from time to time to
allow other work.
The long-running task is started from the GUI in a
separate thread using SwingWorker. It gets suspended
by calling a wait()/notify() from the Event-Dispatch Thread.
This works very well in a 2-tier architecture (client-database).
In a 3-tier setting, presumably the worker thread and
event thread would share a handle to a stateful session bean
on an application server. The appserver may do things like
activate/passivate/swap beans around betewenn processes,use
pooled instances, and other things I understand so poorly that
I'm perhaps not even able to phrase this intelligibly.
But can I be sure that the Thread that gets notified is
the same that was waiting, and that I'm operating
on the same bean instance? If not, do I have to forego the use
of wait() and notify() on the app server and resort to active
waiting?
Thanks for any enlightenment,
Sebastian