sessionBeanID

The build descriptor option sessionBeanID identifies the name of an existing session element in the J2EE deployment descriptor. The environment entries are placed into the session element when you act as follows:

The option sessionBeanID is useful in the following case:

  1. You generate a Java wrapper, along with an EJB session bean. In the EJB project deployment descriptor (file ejb-jar.xml), EGL creates a session element, without environment entries.

    Both the EJB session bean and the session element are named as follows:

      ProgramnameEJBBean

    Programname is the name of the run-time program that receives data by way of the EJB session bean. The first letter in the name is uppercase, the other letters are lowercase.

    In this example, the name of the program is ProgramA, and the name of the session element and the EJB session bean is ProgramaEJBBean.

  2. After you generate the EJB session bean, you generate the Java program itself. Because the build descriptor option genProperties is set to YES, EGL generates J2EE environment entries into the deployment descriptor, into the session element established in step 1.

  3. You generate ProgramB, which is a Java program that is used as a helper class for ProgramA. The values of system and genProject are the same as those used in step 2; also, you generate environment entries and set sessionBeanID to the name of the session element.

    Your use of sessionBeanID causes EGL to place the environment entries for the second program into the session element that was created in step 2; specifically, into the session element ProgramaEJBBean.

In the portion of the deployment descriptor that follows, EGL created the environment entries vgj.nls.code and vgj.nls.number.decimal during step 2, when ProgramA was generated; but the entry vgj.jdbc.default.database is used only by ProgramB and was created during step 3:

<ejb-jar id="ejb-jar_ID">
  <display-name>EJBTest</display-name>
  <enterprise-beans>
    <session id="ProgramaEJBBean">
      <ejb-name>ProgramaEJBBean</ejb-name>
      <home>test.ProgramaEJBHome</home>
      <remote>test.ProgramaEJB</remote>
      <ejb-class>test.ProgramaEJBBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type
      <env-entry>
       <env-entry-name>vgj.nls.code</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>ENU</env-entry-value>
      </env-entry>
      <env-entry>
       <env-entry-name>vgj.nls.number.decimal</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>.</env-entry-value>
      </env-entry>
      <env-entry>
       <env-entry-name>vgj.jdbc.default.database</env-entry-name>
       <env-entry-type>java.lang.String</env-entry-type>
       <env-entry-value>jdbc/Sample</env-entry-value>
      </env-entry>
   </session>
  </enterprise-beans>
</ejb-jar>                  

A session element must be in the deployment descriptor before you can add environment entries. Because session elements are created during Java wrapper generation, it is recommended that you generate the Java wrapper before generating the related programs.

In the following cases, you generate a program into an EJB project, but the environment entries are placed into a J2EE environment file rather than into the deployment descriptor:

For EJB projects, an environment entry name (like vgj.nls.code) can appear only once for each session element. If an environment entry already exists, EGL updates the entry type and value instead of creating a new entry.

EGL never deletes an environment entry from a deployment descriptor.

No default value is available for sessionBeanID.

Related reference
Build descriptor options