1 2 Previous Next 15 Replies Latest reply on May 24, 2006 4:50 PM by Weston M. Price

    JBAS-1241 Background Pool Validation

    Weston M. Price Master

      For http://jira.jboss.com/jira/browse/JBAS-1241:

      This issue popped up the priority stack recently. In looking at this, I propose the following:

      Modify BaseWrapperManagedConnectionFactory to implement the ValdatingConnectionFactory interface from the 1.5 spec. The method exposed is:

      Set getInvalidConnections(Set managedConnecdtions);

      Add validateConnections() method to InternalManagedConnectionPool that is called by an 'external' validating background thread (more on this in a bit).

      The BaseWrapperMCF should validate the set of MC's calling checkValid() much in the same manner as is done in the match method returning the invalid MC's that are then destroyed.

      The real issue I see with this is efficiency. The interface takes a set of MC's, returning the invalid set. Taken at face value this requires 2 passes through the list of connection listeners. One to get the MC's and the next to find the listeners to destroy. Since this has to be synchornized, this could get to be a real bottle neck, background thread or not.

      As an optimization, a JBossValidatingCF interface could be added that took a let of ConnectionListeners and returned the ones that needed to be removed directly. The invalid connections could then be destroyed immiedately.

      We could either add an element to the XML to tell the pool to look for this, set a flag in the constructor, do it dynamically etc, etc.

      As far as a background thread, I don't like using the IdleRemover to do this. I think it should be a seperated thread BackgroundValidator or something like that. Right now the IdleRemove waits on the idle timeout interval. At the very least this would have to be modified, or add another remover to do the validation. If we are going to this, let's just clarify it as another class.

        1 2 Previous Next