You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Christoph Kutzinski (JIRA)" <ji...@apache.org> on 2008/01/06 14:46:33 UTC

[jira] Commented: (POOL-119) GenericObjectPool: Provide option to create new objects serial

    [ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556379#action_12556379 ] 

Christoph Kutzinski commented on POOL-119:
------------------------------------------

Some comments on the patch:
- the field _serialObjectCreation needs to be volatile because it is read from an unsynchronized block
- object creation was refactored into a private method createObject() where also a re-check is done if a different object was returned meanwhile
- I created 3 new test-methods in TestGenericObjectPool to verify the new behaviour. Unfortunately they rely on Thread.sleep, so they might fail spuriously under certain conditions. I couldn't find a way to test it without he sleep. Maybe someone else has a better idea?
- I created a simple Latch class in the test sources to keep the test methods simpler (IMHO).

> GenericObjectPool: Provide option to create new objects serial
> --------------------------------------------------------------
>
>                 Key: POOL-119
>                 URL: https://issues.apache.org/jira/browse/POOL-119
>             Project: Commons Pool
>          Issue Type: New Feature
>    Affects Versions: 1.4
>            Reporter: Christoph Kutzinski
>         Attachments: patch.txt
>
>
> As discussed on the Commons-Dev mailing list:
> In certain scenarios it is desirable to serialize creation of new objects, if the pool needs to grow. This has 2 main advantages:
> - help keeping load away from the engine creating the objects (e.g. the database server) during high load situations
> - avoid unnecessary object creation if objects where returned to pool while multiple 'new' objects are requested from the pool

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.