2 Replies Latest reply on Mar 30, 2004 12:14 PM by richaosu

    Multiple datasources, urgent !!!!

    Marco Rouse Newbie

      Hi all,

      Desperate, I'm working with jboss-3.2.3 and mysql, i can't deploy some ejb, i need to map them to a different database, it's one database with 5 tables per context and i have 10 context, since every instance on the ejb create the same tables i need to use different database, bit i can't deploy, cant get jboss to use several datasources and can't create a auto_increment primary key when deploying the ejb.

      Can someone please help, im on the clock, got my customers to change servers and can't deploy the apps.

        • 1. Re: Multiple datasources, urgent !!!!
          Alexey Loubyansky Master

          Just deploy each bean as many times as many datasources you have.

          • 2. Re: Multiple datasources, urgent !!!!
            richaosu Newbie

            Yes, that was my solution too. I created additional jars in the ear. Each new jar has its own META-INF sub-directory with ejb-jar.xml, jboss.xml and jbosscmp-jdbc.xml files. The additional jars use different EJB bean names but are bound to the same entity and interface classes as exist in the original jar (the binding occurs in ejb-jar.xml) The original jar has the actual classes and it's own META-INF descriptors. The original is bound to one datasouce (in jbosscmp-jdbc.xml) and the others are bound to different datasources. It is not necessary to repeat the classes in the other jars. You do need to identify the additional jars in the application.xml.