2 Replies Latest reply on Aug 20, 2002 10:06 AM by David Jencks

    Connection Pools and Multiple Databases

    Garrick Dasbach Newbie

      We are using JBoss in an environment where we have multiple indentical databases (replicated in real time). One Database takes care of Updates and replicates changes to the slaves which handle Selects. We've been able to handle this fairly easily, but as we more more and more of our material into EJBs (instead of straight JDBC calls), we're running into the problem of choosing a Database to select information out of.

      For Example:

      1 Master - 2 Slaves
      I want to select data from one of the slaves. The actual data in the slaves is identical. In JDBC I have to randomly (or round robin) select one of the 2 DataSources from JNDI, then get a connection and perform the select. However with EJB, I have to have 2 sets of CMP Beans running, each one mapped to one of the Databases, then randomly choose one of the EJB's.

      Is there a way to configure the ManagedConnectionFactory to maintain a Pool of Database connections where half of the connections are from 1 Database and the other half are from another?

      If not, do you know of any 3rd Party JCA connectors for Connection Factories that would allow this type of Clustering Connection Pool?


      Garrick Dasbach
      Software Development
      "Cheap and Easy, Just the way we like it..."