I'm on a webservice server and I have objects with an internal connection.
Initializing this connection takes really long so my idea was to use an object pool to reuse the connections among different requests.
The objects are connected to each user, so i prefer to use the username as key and the connection as value. But I don't want to have the connection open forever. Maybe after a while it should be destroyed if the user does not start requests any more.
I thought about using the apache object pool but i didn't see expiration there (correct me if i'm wrong)
The ehcache offers me notifications about eviction and expiration, but not triggered after the timeout was over, only if the cached object was touched again.
Does someone know a lib which can do this job for me?