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:39:34 UTC
[jira] Created: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
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
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.
[jira] Updated: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Thomas updated POOL-119:
-----------------------------
Fix Version/s: (was: 1.5)
2.0
Pushing this back to 2.0
> 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
> Fix For: 2.0
>
> Attachments: patch.txt, patch2.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.
[jira] Commented: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Christoph Kutzinski (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz updated POOL-119:
-----------------------------
Fix Version/s: 1.5
> 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
> Fix For: 1.5
>
> Attachments: patch.txt, patch2.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.
[jira] Commented: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Christoph Kutzinski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801222#action_12801222 ]
Christoph Kutzinski commented on POOL-119:
------------------------------------------
Unfortunately I don't have the time and the motivation to provide an adapted patch for this.
But maybe someone else is willing to pick this up?
> 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
> Fix For: 2.0
>
> Attachments: patch.txt, patch2.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.
[jira] Commented: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Mark Thomas (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706395#action_12706395 ]
Mark Thomas commented on POOL-119:
----------------------------------
As a result of POOL-125, the proposed patch needs some additional work. Put simply, you can't call any factory method form inside a synchronized block as it introduces the possibility of a deadlock.
I am close to committing a patch for POOL-125. You may wish to wait until after the fix for POOL-125 has been committed before updating your patch.
> 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
> Fix For: 1.5
>
> Attachments: patch.txt, patch2.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.
[jira] Commented: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Christoph Kutzinski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710498#action_12710498 ]
Christoph Kutzinski commented on POOL-119:
------------------------------------------
Thanks for pointing to POOL-125, Mark.
I'll look into adapting the patch when I'll find the time (which won't be much to soon, unfortunately)
> 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
> Fix For: 2.0
>
> Attachments: patch.txt, patch2.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.
[jira] Updated: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Christoph Kutzinski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christoph Kutzinski updated POOL-119:
-------------------------------------
Attachment: patch.txt
Patch to GenericObjectPool and TestGenericObjectPool to fix the described issue with a new option 'serialObjectCreation' which defaults to false.
> 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.
[jira] Updated: (POOL-119) GenericObjectPool: Provide option to
create new objects serial
Posted by "Christoph Kutzinski (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/POOL-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christoph Kutzinski updated POOL-119:
-------------------------------------
Attachment: patch2.txt
I just realized that during re-check if an object was returned, a synchronized-block on 'this' was missing.
Added a 2nd patch just for GenericObjectPool
> 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
> Fix For: 1.5
>
> Attachments: patch.txt, patch2.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.