0 Replies Latest reply on Aug 23, 2004 10:16 AM by madeonmoon

    define datasources once, access by several ejbs

    madeonmoon Newbie

      hello all,

      i have several stateless sessions ejbs that used to define their own datasource via xdoclet:

      *
      * @ejb.bean name="MyBean"
      * description="MyBean"
      * display-name="MyBean"
      * local-jndi-name="MyBeanLocal"
      * jndi-name="MyBean"
      * view-type="both"
      * type="Stateless"
      *
      * @ejb.resource-ref
      * res-ref-name="jdbc/ds1"
      * res-type="javax.sql.DataSource"
      * res-auth="Container"
      *
      * @jboss.resource-ref
      * res-ref-name="jdbc/ds1"
      * jndi-name="java:/DS1"
      *
      * @ejb.resource-ref
      * res-ref-name="jdbc/ds2"
      * res-type="javax.sql.DataSource"
      * res-auth="Container"
      *
      * @jboss.resource-ref
      * res-ref-name="jdbc/ds2"
      * jndi-name="java:/DS2"
      *
      */
      public class MyBean implements SessionBean {
      ...
      }

      Now, i'd like to move datasource references (ds1, ds2, etc) in a once separate config place (whatever that might be) since from this point on, all ejbs i have will access the same several datasources.

      How would i do it?

      Thanks a lot
      james