commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Vendelbo" <hvende...@bluprints.com>
Subject [pool] Keyey pool usage
Date Mon, 03 Nov 2003 18:09:26 GMT
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 ?

Object o1 = borrowObject("somename");
returnObject(o1);
Object o2 = borrowObject("somename");
returnObject(o2);

will o1 == o2 ?

Henrik



---------------------------------------------------------------------
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