2 Replies Latest reply on Mar 20, 2002 7:11 PM by David Jencks

    Dynamically adding a database

    Eric Carlson Newbie

      Can I add a database to JBoss without restarting it?
      I'm thinking of an ecommerce app which serves several sites, each of which consist of their own database. As a new site is added I guess I have to edit the jboss config for its database but will the rest of the sites suffer as jboss gets restarted?

        • 1. Re: Dynamically adding a database
          Marcus Brito Novice

          In JBoss 3.0.0 you can drop the xml file describing the datasource in the deploy directory and JBoss will configure it.

          In your scenario, this would involving creating a XML document containing configuration for the database and then writing this document to the deploy directory.

          • 2. Re: Dynamically adding a database
            David Jencks Master

            As I have indicated in numerous posts in the past, in 2.4 and 3 you can also construct the appropriate mbean in code. A requently run example for 3 is in the DataSourceLoaderUnitTestCase in .../test/jmx/tests. Of course, such configuration will not persist over jboss restarts.

            For 2.4.x I once posted a patch "making configuration service a deployer" as I recall that let you deploy xml bits while jboss is running.