-
1. Re: Accessing an ejb with multiple client threads
frito Oct 15, 2004 3:52 AM (in response to darknight)Concurrent calls on a SFSB are not allowd by spec. Weblogic allows something like this, but they are only synchronising calls. on the same SFSB instance.
You don't have to split your facade, just synchronise the calls.
I hope your facade is not build on EJBs itself, because you must not do thread management and synchronisation in there. -
2. Re: Accessing an ejb with multiple client threads
starksm64 Oct 16, 2004 3:48 PM (in response to darknight)The synchronization behavior could be encapsulated within the stateful session proxy via a custom client side interceptor if all users are doing so through the same instance.
-
3. Re: Accessing an ejb with multiple client threads
akifshaikh99 Dec 20, 2004 4:14 PM (in response to darknight)I am having the same problem and trying to solve it using container interceptors instead of client interceptors since the EJB clients will not be going through the same client.
Can I use a built in JBoss interceptor and plug it in the container interceptor list or do I have to write one. I have been trying to write a simple interceptor , overriding the invoke method but I am unable to find the object on which I should synchronize on .. I have tried
the EnterPriseContext
the EJBObject
Invocation.getId()
any ideas what should i sync on
basically -
synchronize(x){
return nextInterceptor.invoke(mi);
}
I need to know what is x and how do I get it.
Thanks -
4. Re: Accessing an ejb with multiple client threads
frito Dec 21, 2004 3:52 AM (in response to darknight)AFAIK, every container has its own instances of interceptors. Why not introducing an attribute in your interceptor which you can use for synchronisation?
I would rather think about not using synchronisation blocks by myself but using the oswego tools, which even come with jboss (concurrent.jar). The reentrant lock could be helpful for solving your problem:
http://dsd.lbl.gov/~hoschek/javatree/share/misc/concurrent-1.3.2/doc/edu/oswego/cs/dl/util/concurrent/ReentrantLock.html