5 Replies Latest reply on Jan 21, 2009 11:37 PM by Maxim Pavlov

    Stateful EJB's cached in container ignored by SEAM when injected.

    David Martin Newbie

      Hello,


      We are using stateful EJB’s extensively in our project.  Using the Weblogic server admin console we have noticed that excessive EJB’s are created to support a single Seam invocation.  The problem is compounded when a Seam component contains injected stateful EJB’s (and they contain injected EJB’s and so on).  It appears that new EJB’s are created each time (cached ones are ignored) until the containers cached max is reached (in our case 1000 for each stateful EJB).  Once the cached max for an EJB is reached, all invocations from that point result in numerous EJB’s being passivated.  It appears some of the cached beans do get reused but very very few.  We are concerned that this will be a performance issue with multiple users hitting our application – we want to make sure we are not missing something in our configuration.


      We have configured all the EJB’s as documented in the SEAM docs for Weblogic – everything is working.  We are only using local interfaces for our EJB’s.


      Sample web.xml configuration:



      <ejb-local-ref>
           <ejb-ref-name>texdt/RoadListBean/local</ejb-ref-name>
           <ejb-ref-type>Session</ejb-ref-type>
           <local>texdt.action. RoadList</local>
           <ejb-link>RoadListBean</ejb-link>
       </ejb-local-ref>
      



      Sample ejb-jar.xml configuration:



        <interceptor-binding>
            <ejb-name>RoadListBean</ejb-name>
               <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
         </interceptor-binding>
      



      Sample EJB being injected into parent stateful session bean (we have to include the @EJB annotation or an exception is thrown – similar to OC4J and Glassfish):



          @In(create=true)
          @EJB(name="texdt/RoadListBean/local")
          private RoadList roadList;
      



      We are using Seam 2.1.0.GA on the Weblogic 10.3 application server and Richfaces 3.2.2.GA for our JSF components.


      Any help would be appreciated.


      Thanks