commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Verbeeck <dirk.verbe...@pandora.be>
Subject Re: [pool] Keyey pool usage
Date Mon, 03 Nov 2003 21:42:37 GMT
See inline for answers but I suspect you really need a cache and not a pool.

related question/answer:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-user@jakarta.apache.org&msgNo=2693

-- Dirk

Henrik Vendelbo wrote:

> Browsing the mailing-list archive made me wonder if the pools are inteded
> for the use I seek.
> 
> I have information stored in a database, and want to retrieve it as rarely
> as possible.
> 
> When I need a piece of information I want to borrow it from the pool and
> return it when I am done with it.
> 
> I may borrow the same object multiple times and obtain the same object, be
> it in parallel or sequentially.
> 
> Suppose I do the following :
> 
> Object o1 = borrowObject("somename");
> Object o2 = borrowObject("somename");
> Object o3 = borrowObject("somename");
> returnObject(o1);
> returnObject(o2);
> returnObject(o3);
> 
> will the three objects be the same ?
no

> Object o1 = borrowObject("somename");
> returnObject(o1);
> Object o2 = borrowObject("somename");
> returnObject(o2);
> 
> will o1 == o2 ?
not guarantied, but probably yes

> Henrik


Dirk



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message