1 Reply Latest reply on Jul 23, 2004 3:03 PM by Steve Lewis

    Different connections for queries and updates

    posselt Newbie

      Hi there,

      Is it possible to specify a datasource with different nodes for updates and queries?

      I have access to a MySQL cluster with one write master and several read slaves.
      All write accesses have to go to the write master. Hence, with my current
      deployment, all read accesses also have to go to the write master instead of
      spreading them all over the read slaves.

      I could also deploy two different datasources, one beeing read only, however, I
      would have to tell the CMP to use them both and AFAIK this is not possible.


        • 1. Re: Different connections for queries and updates
          Steve Lewis Expert

          I'd have two beans, one for writing, and one for reading. Even if it's the same Java, the descriptors will be different. Your code will need to look up ReadCMP when it reads, and WriteCMP when it writes.

          We use Oracle with replication, which is nice, but it isn't cheap. I'm not sure if there's a satisfactory CMP-ish solution to your problem.