1 Reply Latest reply on Jan 31, 2005 8:22 PM by hariv

    Cluster SessionBean Questions

      I have the following problems when trying to set a JBoss cluster:

      It's an online financial trading application. The first problem is with the Session Bean which methods are called by the Data Feed to update the quotes. There are 2 JBoss servers running in cluster mode but when the Data Feed calls method of Session Bean on one of the servers, the new quotes are not propagated to the other one.

      Here's the code of the Data Feed which invokes the Session Bean:

      ==============================
      Data Feed

      ????..
      Properties props = new Properties();props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
      props.put(Context.URL_PKG_PREFIXES,"jboss.naming:org.jnp.interfaces");
      props.put(Context.PROVIDER_URL,"server1:1100,server2:1100");
      InitialContext jndiContext = new InitialContext(props);
      Object ref = jndiContext.lookup(obj_ref);
      inssh = (InstrumentSessionHome) PortableRemoteObject.narrow(ref, InstrumentSessionHome.class);
      inss = inssh.create();
      ?????..
      inss. changeQuotes (bq, sq);
      ?????
      ==============================

      This is fragment of the code of the Session Bean:

      public class InstrumentSessionBean implements SessionBean {

      public static Hashtable buyQuotes = new Hashtable();
      public static Hashtable sellQuotes = new Hashtable();
      ???..

      public void changeQuotes(Hashtable bq, Hashtable sq) throws Exception{
      buyQuotes=bq;
      sellQuotes=sq;
      }

      ???.

      =============================

      Here are the settings for the deployment of the Session Bean:

      Jboss.xml



      ??.
      <enterprise-beans>
      ??

      <ejb-name>InstrumentSessionBean</ejb-name>
      <jndi-name>ejb/InstrumentSession</jndi-name>
      True
      <cluster-config>
      <partition-name>DefaultPartition</partition-name>
      <home-load-balance-policy>
      org.jboss.ha.framework.interfaces.RoundRobin
      </home-load-balance-policy>
      <bean-load-balance-policy>
      org.jboss.ha.framework.interfaces.RoundRobin
      </bean-load-balance-policy>
      </cluster-config>

      ?..

      ==============================

      ejb-jar.xml

      <ejb-jar>
      ??.

      N/A
      <ejb-name>InstrumentSessionBean</ejb-name>
      InstrumentSessionHome
      InstrumentSession
      <ejb-class>InstrumentSessionBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      ??
      </ejb-jar>