Design Question: Pausing a process in a 3-tier architecture

  • Thread starter Sebastian Millies
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top