2 Replies Latest reply on Sep 27, 2006 12:06 PM by agentblueuk

    Cloning instances of EJBs in .EAR file

    madopc

      Hi

      I am trying to create multiple instances of an enterprise application, .ear file in JBoss 2.4.4. The application EJBs are to be called by mutiple instances of the web application in a standalone servlet engine Tomcat 4.03 which were developed to call a set of EJB deployed from in an .ear.

      The code looks like:

      ...
      DataSource ds = (DataSource)ctx.lookup("java:/Mydatasource");
      ....


      Is it possible to add something like this in jboss.xml to redirect the datasource into another database?
      ...
      </entity>
       <resource-ref>
       <res-ref-name>java:/Mydatasource</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <jndi-name>java:/Mydatasource1</jndi-name>
       </resource-ref>
      .....
      

      I would like to create multiple instances of EJBs calling different databases with different connection setings in jboss.jcml. My task is to redeploy the application and not modify the code.

      Is this achievable?

      /madock