My solution. Write a servlet filter that synchronizes on the session 
object before child invocation.

-dain

Mikhail Akopov wrote:

> Hi all.
> 
> Rather often problem: access to the same bean from several threads.
> (e.g. servlet which works with multiframed HTML).
> 
> Usual solution is to create sychronized wrapper around bean as it is
> done in petstore. But IMHO this is some kind of profanation of EJB
> idea.
> 
> So I have a suggestion: use entity bean as a facade (against usual way
> of having session bean facade). This will provide several bean
> instances - one per each thread. On the other hand that'll be the only
> bean, i.e. all the problems of threads cooperation will be solved
> automatically. Well, we'll pay memory for multithread syncronization
> but isn't it one of basic ideas of EJB?
> 
> Using special high-speed datasource (such as Hypersonic SQL) which
> stores all tables in memory will prevent perfomance problems.
> 
> Thanks in advance for any critics. Just explain me why this idea is
> wrong and/or stupid.
> 
> Vale! - Mikhail Akopov 
> 
> P.S. Sorry for possible errors - English is my second language.
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to