Need urgent help: how to avoid concurrent calls on statefull session beans
843829May 11 2003 — edited May 17 2003Hi,
I need a little advice in designing a EJB session facade using JSPs, servlets, session and
entity beans.
My current design is:
- JSP pages: here are only getMethods for the session bean used. All set-methods are handled by a
- servlet: I have got one servlet handling several JSP pages. The servlet basically takes the
form fields and stores them in the session bean and than dispatches to the next JSP-page
- stateful session bean: here is, where all the business logic is conducted. There is one session
bean per servlet using several
- CMP entity beans: to talk to the database (Oracle 8i)
The application server is JBoss 3.0.3.
My problem is, if a user clicks on a submit button of a JSP page more than once before the next
page builds up, I may get a "javax.ejb.EJBException: Application Error: no concurrent calls on
stateful beans" error. I already synchronized (by the "session") the code in the servlet, but
it happens in the JSP pages as well.
I know, that Weblogic is able to handle concurrent calls, by JBoss isn't and it's clearly stated
in the spec, that a user should avoid to have concurrent calls to a stateful bean.
The big question is now: How can I avoid this? How can I prohibit the user to submit a form several
times or to ignore anything, which arrives after the first submit?
Thanks for any help,
Thorsten.