Hi!
Here is what have have in mind

1. have the JSF backing bean to have the same convesation name. The service bean is singleton scope

  2. have the runnable in its own conversation, the conversation ends when
the run method ends
      I also have another instance of same service bean, with different name
in prototype mode.

  3. The scheduler task in its own converstion scope, similar to 1

  4. Use LocalFrameworkAdapter for each runnable and also in each scheduler
task.
It is so hard to tell without having a look at the code. If you could sometimes setup a small app showing the problems it would be a lot easier.

What you have outlined above sounds not that bad - having an LFA per thread should fix any concurrency issues. You just have to keep in mind, that if you pass entities between threads the entity is "detached" for the other thread - or at least has a different EntityManager attached to it. Passing entities between conversations (which in fact is what you get with the "LFA per thread" scenario" should be avoided - but ok, this depends on how to work with them.

Ciao,
Mario

Reply via email to