2 Replies Latest reply on Mar 2, 2004 3:51 AM by glyn_walters

    RO/RW pattern questions

    glyn_walters

      Hi

      I have a couple of questions about the RW/RO pattern.

      1. Is it valid to use the Clustered CMP 2.x EntityBean container configuration with commit B for the RW deployment? Or should I use commit C?

      2. This is definitely a newbie question but I can't see how to differentiate in my session bean deployment ejb-ref between a RO and RW deployment of the same EJB.

      I have my EJB deployed like this

      <jboss>
       <enterprise-beans>
       <entity>
       <ejb-name>BBClientEJB-RO</ejb-name>
       <jndi-name>BBClientHome-RO</jndi-name>
       ..etc.
       </entity>
       <entity>
       <ejb-name>BBClientEJB-RW</ejb-name>
       <jndi-name>BBClientHome-RW</jndi-name>
       ..etc.
       </entity>
      </jboss>
      


      And my SLSB like this
      <ejb-ref>
       <ejb-ref-name>ejb/BBClientHome</ejb-ref-name>
       <ejb-ref-type>Entity</ejb-ref-type>
       <home>com.brokerbox.bbserver.server.BBClientHomeRemote</home>
       <remote>com.brokerbox.bbserver.server.BBClientRemote</remote>
      </ejb-ref>
      


      As I understand it the ejb-ref-name is the jndi bind name for the EJB references within the SLSB instance. Should I be trying to reference one of the -RO or -RW deployments? And how would I do that?

      Thanks
      Glyn

        • 1. Re: RO/RW pattern questions
          glyn_walters

          I've just spotted the <jndi-name> tag for <ejb-ref> so I think that's the answer to one my questions above. I'm now getting an error with my deployment of the 2 EJB entities.

          The error is because they are both sharing the same schema. Presumably this is a neccessary feature of the pattern. Is there something I am doing wrong in the deployment?

          The error is:
          18:54:42,913 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.2.3/server/all/farm/BBServer.jar org.jboss.deployment.DeploymentException: BBClientEJBRW: Duplicate abstract-schema name 'BBClient'. Already defined for Entity 'BBClientEJBRO'.

          The config is like this:

          <ejb-jar>
           <enterprise-beans>
           <entity>
           <ejb-name>BBClientEJBRO</ejb-name>
           <home>com.brokerbox.bbserver.server.BBClientHomeRemote</home>
           <remote>com.brokerbox.bbserver.server.BBClientRemote</remote>
           <ejb-class>com.brokerbox.bbserver.server.BBClientBean</ejb-class>
           <persistence-type>Container</persistence-type>
           <prim-key-class>java.lang.String</prim-key-class>
           <reentrant>False</reentrant>
           <cmp-version>2.x</cmp-version>
           <abstract-schema-name>BBClient</abstract-schema-name>
           <cmp-field><field-name>userID</field-name></cmp-field>
           <cmp-field><field-name>fullname</field-name></cmp-field>
           <cmp-field><field-name>orgID</field-name></cmp-field>
           <cmp-field><field-name>brokerOrgID</field-name></cmp-field>
           <cmp-field><field-name>orgGroup</field-name></cmp-field>
           <cmp-field><field-name>userType</field-name></cmp-field>
           <cmp-field><field-name>securityBitSet</field-name></cmp-field>
           <cmp-field><field-name>clientType</field-name></cmp-field>
           <cmp-field><field-name>running</field-name></cmp-field>
           <cmp-field><field-name>connected</field-name></cmp-field>
           <cmp-field><field-name>verboseReporting</field-name></cmp-field>
           <cmp-field><field-name>available</field-name></cmp-field>
           <cmp-field><field-name>callbackProperties</field-name></cmp-field>
           <primkey-field>userID</primkey-field>
           <security-identity><use-caller-identity/></security-identity>
           <query>
           <query-method>
           <method-name>findByOrganisation</method-name>
           <method-params>
           <method-param>java.lang.String</method-param>
           </method-params>
           </query-method>
           <ejb-ql>
           SELECT OBJECT(c) FROM BBClient c
           WHERE c.orgID = ?1
           </ejb-ql>
           </query>
           </entity>
           <entity>
           <ejb-name>BBClientEJBRW</ejb-name>
           <home>com.brokerbox.bbserver.server.BBClientHomeRemote</home>
           <remote>com.brokerbox.bbserver.server.BBClientRemote</remote>
           <ejb-class>com.brokerbox.bbserver.server.BBClientBean</ejb-class>
           <persistence-type>Container</persistence-type>
           <prim-key-class>java.lang.String</prim-key-class>
           <reentrant>False</reentrant>
           <cmp-version>2.x</cmp-version>
           <abstract-schema-name>BBClient</abstract-schema-name>
           <cmp-field><field-name>userID</field-name></cmp-field>
           <cmp-field><field-name>fullname</field-name></cmp-field>
           <cmp-field><field-name>orgID</field-name></cmp-field>
           <cmp-field><field-name>brokerOrgID</field-name></cmp-field>
           <cmp-field><field-name>orgGroup</field-name></cmp-field>
           <cmp-field><field-name>userType</field-name></cmp-field>
           <cmp-field><field-name>securityBitSet</field-name></cmp-field>
           <cmp-field><field-name>clientType</field-name></cmp-field>
           <cmp-field><field-name>running</field-name></cmp-field>
           <cmp-field><field-name>connected</field-name></cmp-field>
           <cmp-field><field-name>verboseReporting</field-name></cmp-field>
           <cmp-field><field-name>available</field-name></cmp-field>
           <cmp-field><field-name>callbackProperties</field-name></cmp-field>
           <primkey-field>userID</primkey-field>
           <security-identity><use-caller-identity/></security-identity>
           <query>
           <query-method>
           <method-name>findByOrganisation</method-name>
           <method-params>
           <method-param>java.lang.String</method-param>
           </method-params>
           </query-method>
           <ejb-ql>
           SELECT OBJECT(c) FROM BBClient c
           WHERE c.orgID = ?1
           </ejb-ql>
           </query>
           </entity>
           ..etc.
          </ejb-jar>
          


          Thanks for any help on this
          Glyn


          • 2. Re: RO/RW pattern questions
            glyn_walters

            The answer being RTFM :) <table-name>