def session(&block)
      s = nil
      begin
        s = @pool.checkout
        block.call(s)
      rescue javax.jms.JMSException => e
        s.close rescue nil
        @pool.remove(s)
        s = nil # Do not check back in since we have removed it
        raise e
      ensure
        @pool.checkin(s) if s
      end
    end
def session(&block)
      s = nil
      begin
        s = @pool.checkout
        block.call(s)
      rescue javax.jms.JMSException => e
        s.close rescue nil
        @pool.remove(s)
        s = nil # Do not check back in since we have removed it
        raise e
      ensure
        @pool.checkin(s) if s
      end
    end
Obtain a session from the pool and pass it to the supplied block
 The session is automatically returned to the pool once the block completes

 In the event a JMS Exception is thrown the session will be closed and removed
 from the pool to prevent re-using sessions that are no longer valid