5 Replies Latest reply on Mar 11, 2002 10:48 AM by ericcire

    Hot Deploy a DataSource?

    ericcire

      Is it possible to define a new database in JBoss without restarting?

      I am writing an application that connects to over 100 databases. Every week or so databases are added and removed. All the databases are Ingres, and use the same driver. The databases are located on about 10 different servers.

      I have been registering new databases in JBoss by adding to the jboss.jcml file. How can I hot deploy new databases, so as to use the DataSource functionality and container transactions?

      Any ideas would be greatly appreciated.


      Eric

        • 1. Re: Hot Deploy a DataSource?
          davidjencks

          Well, the "datasource loader" is just an mbean, so you can create it programatically. I don't think I know of any examples for XADataSourceLoader for jboss 2.4. For jboss 3, there is an example of constructing a ConnectionFactoryLoader in the org.jboss.test.jmx.test.DataSourceLoaderUnitTestCase. You should be able to adapt it easily to XADataSourceLoader. Be sure to give each mbean you construct a unique object name.

          Note that these datasource are NOT persistent over server shutdown/restart. I imagine you would have a metadata repository you would scan to set them all up.

          Other approaches:

          in jboss 3 you can deploy each datasource in its own config file at any time.

          There is a patch "making configuration service a deployer" that provides similar functionality for maybe 2.3 or 2.4. It might work on current jboss 2.4.4 also, but you'd probably be better off with jboss 3.

          • 2. Re: Hot Deploy a DataSource?
            ericcire

            Thanks,

            By setting the sum of the two values to be less than the driver timeout, I have no more problems. Thanks!

            Eric

            • 3. Re: Hot Deploy a DataSource?
              ericcire

              Thank,
              Eric

              • 4. Re: Hot Deploy a DataSource?
                ericcire

                Thanks,
                Eric

                • 5. Re: Hot Deploy a DataSource?
                  ericcire

                  Thanks,
                  Eric