| Author |
No concurrent calls on stateful beans
|
Vikky Bhat
Greenhorn
Joined: Oct 23, 2008
Posts: 20
|
|
Hi,
we are using Jboss 4.2.1 GA. i have many state full session beans in my application. apllication is working fine. but upon concurrent user testing apllication crashed and server thrown error "No concurrent calls on stateful beans exception"
stack trace....
[color=red][STDERR] java.rmi.ServerException: EJBException:; nested exception is: javax.ejb.EJBException: Application Error: no concurrent calls on stateful beans
2009-02-10 16:44:03,276 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:365)
2009-02-10 16:44:03,276 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:209)
2009-02-10 16:44:03,276 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
2009-02-10 16:44:03,276 ERROR [STDERR] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
i know this is because we dint use any allowConcurrentcall like flag in jboss.xml deployment descriptor like we use in weblogic. even i doubt whether jboss would support such tag or not???..
please jboss experts help me out. i saw it in jIRA the bug mentioned was in open status.....
|
SCJP, SCWCD, WIPO-IP
|
 |
Javid Jamae
Author
Ranch Hand
Joined: May 14, 2008
Posts: 198
|
|
|
Are you using a testing tool that is passing in the same session id for all the threads/users it generates?
|
Author: JBoss in Action, javidjamae.com, @javidjamae on Twitter
|
 |
Vikky Bhat
Greenhorn
Joined: Oct 23, 2008
Posts: 20
|
|
Thanks for swift reply Javid,
Actually problem occurs when user makes a re-entrant call i.e when user clicks on a submit or next image more than once or when two users are trying to submit the form on same time. actually the application is meant for a on-line test portal, where the users will simultaneously access the ejb instance. is there any way in the jboss to override the ejb2.x specs for accessing session beans. in weblogic we use allowConcurrentCalls flag TRUE. please get me a workaround.
|
 |
Javid Jamae
Author
Ranch Hand
Joined: May 14, 2008
Posts: 198
|
|
|
I'm not sure if there is a way to disable this, but I don't think that would be a good idea. The whole point of a Stateful bean is that it manages state for each user independently. I think you should consider rethinking your strategy. What exactly are you trying to accomplish?
|
 |
Vikky Bhat
Greenhorn
Joined: Oct 23, 2008
Posts: 20
|
|
Thank you Javid,
yes i agree to your point...The EJB 2.0 specification specifically disallows multiple simultaneous accesses to the same stateful session bean. If a client-invoked business method is in progress on an instance when another client-invoked call, from the same or a different client, arrives at the same instance, the container may throw RemoteException to the second client, if the client is a remote client, or EJBException if the client is a local client. This is in contrast to entity and stateless session beans, which have new instances created by the container when concurrent calls occur. In certain special circumstances (for example, to handle clustered web container architectures), the container may instead queue or serialize such concurrent requests. However, the clients can not rely on this behavior. Note that this concurrent call restriction forbids loopback calls on stateful session beans as well.
i did the following workaround for the problem. by doing this i have to compromise with the performance of the application i.e with the response time. In my session facade bean, I surround all accesses to the stateful session bean with synchronization blocks, locking on the SSB. This will prevent more than one thread accessing the SSB; once a thread has entered the SSB any additional threads will be queued.
|
 |
 |
|
|
subject: No concurrent calls on stateful beans
|
|
|