5 Replies Latest reply on Apr 29, 2003 3:40 AM by blakbox

    datasource configuration at runtime

    blakbox Newbie

      Hi,

      In my last post, i said that I wanted to get a datasource from one jboss to another. This is not possible.
      So, to solve my problem, I need to configure at runtime the datasource to specify the database's ip.

      how can I do that?

      thanks

        • 1. Re: datasource configuration at runtime
          David Jencks Master

          in jboss 4 the managed connection factory config-properties (such as db url) are exposed directly as jmx attributes. For 3.0.7 and 3.2 there's a setManagedConnectionFactoryAttribute(name, class, value) jmx operation you can use.

          I don't see the connection between needing a datasource on the local vm and needing to configure its target database dynamically.

          • 2. Re: datasource configuration at runtime
            blakbox Newbie

            Sorry, I'm a newbie,

            I have a jboss that has an stateless session bean working with a database in another machine. The problem is that this jboss doesn't know the location of the database. So, I have another machine with another jboss that knows this information. Then my intention was that the second jboss provided the DataSource to the first jboss could work with the database. Because you said that's impossible, i need that the first jboss get the database's ip from the second and configure the datasource to work with the database.

            Great thanks

            • 3. Re: datasource configuration at runtime
              blakbox Newbie

              Sorry, I'm a newbie,

              I have a jboss that has an stateless session bean working with a database in another machine. The problem is that this jboss doesn't know the location of the database. So, I have another machine with another jboss that knows this information. Then my intention was that the second jboss provided the DataSource to the first jboss could work with the database. Because you said that's impossible, i need that the first jboss get the database's ip from the second and configure the datasource to work with the database.

              Great thanks

              • 4. Re: datasource configuration at runtime
                David Jencks Master

                What is stopping you from deploying the same datasource configurations on all of your jboss instances? I think you can automate this using the farm deployer, so you deploy on one and the farm service deploys on all the other instances.

                • 5. Re: datasource configuration at runtime
                  blakbox Newbie

                  ok, I'm going to try it.
                  Thanks