0 Replies Latest reply on Jun 26, 2003 7:42 AM by topicfun

    context.getPrimaryKey() = null

    topicfun Newbie

      context.getPrimaryKey() = null


      Hi!

      I have a bean managed pers. When the container calls the ejbActivate method and try to get the primarykey it's value is null. After that the ejbLoad does'nt work.

      public void ejbActivate() {
      appInstance = new Bigdecimal((String)context.getPrimaryKey());
      }

      here are my xmls concerning the pk:
      ejb.xml

      <ejb-jar>
      <display-name>ConfigDataJAR</display-name>
      <enterprise-beans>

      <display-name>ConfigDataBean</display-name>
      <ejb-name>ConfigDataBean</ejb-name>
      at.siemens.mma.iap.config.ConfigDataHome
      at.siemens.mma.iap.config.ConfigData
      <ejb-class>at.siemens.mma.iap.config.ConfigDataBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.math.BigDecimal</prim-key-class>
      False
      <security-identity>

      <use-caller-identity></use-caller-identity>
      </security-identity>
      <resource-ref>
      <res-ref-name>jdbc/InsatncesDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
      <primkey-field>appInstance</primkey-field>

      </enterprise-beans>
      .
      .
      jaws.xml


      java:/OracleDS
      <type-mapping>Oracle8</type-mapping>

      <enterprise-beans>

      <ejb-name>ConfigDataBean</ejb-name>
      <table-name>Instances</table-name>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <cmp-field>
      <field-name>appInstance</field-name>
      <column-name>Application_Instance</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>tvChannel</field-name>
      <column-name>TV_Channel</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>appID</field-name>
      <column-name>Application_ID</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>state</field-name>
      <column-name>State</column-name>
      </cmp-field>

      </enterprise-beans>


      I have seen the context which has a value. The create works properly but after I can't use the get* methods because the getPrimaryKey gives back null.

      Thanks your help in advance!

      Best Regards
      Topicfun