commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14982] - GenericObjectPool does not work with null factory.
Date Sun, 01 Dec 2002 18:30:28 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14982>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14982

GenericObjectPool does not work with null factory.





------- Additional Comments From rwaldhoff@apache.org  2002-12-01 18:30 -------
> The descriptions of the GenericObjectPool 
> constructors state that factory may 
> be "possibly null". This is a desirable 
> feature, but its implementation is 
> buggy and incomplete.

Those comments are correct, if slightly misleading. The GenericObjectPool 
constructors *do* allow a null value for the PoolableObjectFactory, but clients 
must call setFactory() to set the factory to a non-null value before using the 
pool.

> The pool is unusable with null factory:

That is correct. I've added a note to the javadoc comments clarifying this.  

> need addNewObject() method

I'm not sure GenericObjectPool is especially useful without a 
PoolableObjectFactory, since much of its functionality is aimed at destroying 
objects when they're not likely to be needed or useful.  Much of what 
GenericObjectPool is doing can't be done without a Factory.

> For convenience there should 
> be constructors that do not 
> require passing  factory at all.

I've added a no-arg constructor, which will allow GenericObjectPool to be 
configured in a fully bean-ish fashion.

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message