You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by William Ferguson <wi...@versata.com> on 2002/01/22 07:40:06 UTC

pools - borrowing from pools

Hi all,

I'm using the common-pools and was wondering how most people handle failure
to borrow from a pool.
Ie ObjectPool.borrowObject() doesn't declare any checked Exception, so how
are clients meant to be notified that a pooled Object cannot be supplied?


Should the implementation throw an unchecked Exception?
This doesn't seem right as unchecked Exceptions are normally reserved for
misuse of an API by a client.
But in this case the client has no means of determining whether the pool can
supply an Object.


But assuming this is the std means of notification, what's the common
implementation.
1) Create a class of unchecked Exception which is thrown when the pool
cannot supply an object or
2) Have the client catch all RuntimeExceptions and assume that is what this
failure represents



William Ferguson


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>