4 Replies Latest reply on Oct 12, 2002 12:03 AM by srinij77

    multiple datasources

    marcwea

      Hello,

      I am sure it is possible, I just would like to use multiple datasources with jboss for different postgres databases. So far the application is working fine with one (still some deadlock issue though). So if someone can point me to somewhere (docs - link) that can explain me how, that would be great; the setup in jboss and also how to specify for a CMP2.0 Bean which datasource to use.
      Thank you very much.

      Marc

        • 1. Re: multiple datasources
          marcwea

          I forgot to say I am using JBoss3.0.0.

          Marc

          • 2. Re: multiple datasources
            srinij77

            Did you find any doc on this. I am looking for similar.

            Thanks.

            • 3. Re: multiple datasources
              tool

              1. Have one service file in the deploy directory for each data source.
              2. Make sure that each data source has a unique JNDI name.
              3. Have the bean(s) connect to the data sources through JNDI lookups using those unique names paired with DataSource objects.

              if you are using JAAS security for your beans then there is an extra step but you haven't mentioned anything like that.
              The deadlock issues have to be resolved in your database or in your bean code (i.e. locking and unlocking tables, checking for table locks, etc.)

              Hope it helps,
              tool

              • 4. Re: multiple datasources
                srinij77

                Thanks for your response.
                This looks interesting.
                Can you please explain the point 3 in detail with example?