4 Replies Latest reply on Nov 28, 2006 4:21 AM by timfox

    HAConnectionFactory UseCase question

    clebert.suconic

      I have to define what's the UseCase on HAConnectionFactory.

      I could either define the load balancing policy on jndi.lookup or connectionFactory.createConnection.

      Let me explaing through examples:

      On these examples I have serverA, B and C. Immagine subsequent calls to either jndi.lookup or factory.createConnection doing a load balancing. (Round Robbin probably)

      Example I:

      connectionFactory.createConnection(); << returns a connection pointing to server A
      connectionFactory.createConnection(); << server B
      connectionFactory.createConnection(); << server C
      



      Example II:

      ConnectionFactory factoryA = jndi.lookup(); // this connection will always point to A
      ConnectionFactory factoryB = jndi.lookup(); // this connection will always point to B
      ConnectionFactory factoryC = jndi.lookup(); // this connection will always point to c
      


      We could implement it either way. At this point I have assumed Example I, but we need to define if this is the correct behavior.