0 Replies Latest reply on Aug 24, 2005 5:38 AM by aho

    Tomcat and EJB3 Clustering

    aho

      I am using JBoss_4.0.3RC1, upgraded with Jboss_EJB3.0_RC1. The JBoss AS with a simple clustered Stateful Session Bean which keeps the number of counts it has been accessed, is deployed in two server machines. The Session Bean is accessed by JSP deployed in the web container of the JBoss AS. I am fronting JBoss' Tomcat with Apache2 in another web server and was able to make request to either one of the JBoss AS server machine if one of them is shutdown. However, I could not simulated the replication of the Stateful Session Bean. I tested acessing a JBoss AS server machine and increase the count, then shutdown this server, and the request is diverted to the other server, but the count starts from 1. I am expecting the count to continue from where I last started. Would appreciate if someone point out whether my expectation is correct and what's the solution if my requirement to keep the counter is to be achieved.

      Here's a snippet of my session bean

      @Stateful
      @Clustered
      @Remote(AccountMaintenance.class)
      public class AccountMaintenanceBean implements AccountMaintenance, Serializable {
      @PersistenceContext(unitName="MySqlMgr")
      private EntityManager manager;
      private int hitcount = 0;
      private String SessionName = "Compaq nx5000 - Hit Count : ";

      public String increment() {
      hitcount ++;
      return SessionName + Integer.toString(hitcount);
      }