3 Replies Latest reply on Apr 12, 2005 11:53 AM by milowe

    Am I able to relocate <datasource-mapping/> ?

    cvandyck

      This is under JBoss 3.2.3.

      We deploy our application to clients with various datasources. To date we've kept the datasource-mapping for the CMP layer in

      ejb.jar/META-INF/jbosscmp-jdbc.xml

      But that means we have to package two different versions of our product to use the different kinds of datasources, the only difference being the <datasource-mapping/> element (mySQL, MS SQLSERVER, etc).

      Is there a way I can supply this value programmatically instead of having it in jbosscmp-jdbc.xml so that we can just supply one version of our product?

      many thanks,
      Collin

        • 1. Re: Am I able to relocate <datasource-mapping/> ?
          tbech

          You reported similar topic as me in 'http://www.jboss.org/index.html?module=bb&op=viewtopic&t=62276'

          My situation is more annoying as I have to modify Java files as well to switch the DB. It is my first BIG dissapointment after a year of using JBoss.

          Unfortunately I cannot help you, I don't see any way to do it (at least in 3.2.x). Just idea - if possible to have the way of retrieving metadata of descriptors and changing some parameters (like datasource-mapping) just after deployment of jar/ear.

          • 2. Re: Am I able to relocate <datasource-mapping/> ?
            cvandyck

            From what I've read, in the 4.x series there is a way to abstract this information out. Unfortunately, I can't expect some of our customers to accept a major app server version change for this.

            :(

            Any ideas anyone? Could I write an MBean that set some property somehow?

            • 3. Re: Am I able to relocate <datasource-mapping/> ?
              milowe

              You could try to change the default DS settings for each installtion (if you dont keep all these identical). Set the in conf/standardjbosscmp-jdbc.xml for the data source for that server. Might work, but not sure if resolving datasource-mapping works. Browsing the DTD for 3.2, it says that datasource and datasource-mapping are optional (either none or both). It would be nice if the datasource-mapping could be looked up for the given datasource.