Commons Dbcp
  1. Commons Dbcp
  2. DBCP-291

setting maxWait does not work as expected

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Labels:
      None

      Description

      My expectation was that if maxWait is set to X seconds and there are N requests waiting to get a connection (in a case where the pool is bounded and
      all the connection are used) if none of the used connection gets free than all N requests will time-out at the same time.
      In reality it seems that 1 request will be timed-out after X seconds the second one after 2 * X and the last one after N * X.
      The problem is that getPooledConnectionAndInfo is synchronized (and therefore will look all N requests) and only one request will be processed at the time.
      This process includes waiting until freed connection or timed-out (done by commons.pool GenericKeyedObjectPool).
      I am not sure why the getPooledConnectionAndInfo has to be synchronized and not only the pool creation part.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Arie
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development