I have a JSF 2.0 application running on GlassFish v3. It has EJBs that serve database data via JPA for the main applications sessions. Even on non-IDE app-server, the EJB calls are very slow. Between some pages, the user has to wait over 10 seconds to get to the next page.
The EJB runs on the same application server, and only Local
interface is used. The EJB is injected via @EJB
annotation.
Any clues?
Thanks in advance, Daniel
EDIT See my answer for solution.
The problem was previously, that both Local
and Remote
interfaces had been implemented, and only the Remote
interface was used, however there is no need for that. Both interfaces had the same methods, which is something to avoid according to the NetBeans warning message I got:
When a session bean has remote as well as local business interface, there should not be any method common to both the interfaces.
More detailedly:
The invocation semantics of a remote business method is very different from that of a local business method. For this reason, when a session bean has remote as well as local business method, there should not be any method common to both the interfaces. Example below is an incorrect use case:
Remote public interface I1 { void foo();}
Local public interface I2 { void foo();}
Stateless public class Foo implements I1, I2 { ... }
So the solution was to remove the Remote
interface, and set the application logic to use the Local
interface.