Re: Object pooling
On Sun, 19 Sep 2010, Robert Klemme wrote:
On 19.09.2010 15:49, Tom Anderson wrote:
I have some heavyweight objects that i would like to try pooling.
To be specific, they're JAX-WS (actually JBossWS) Service (and/or port)
objects. My observations so far are that they take hundreds of
milliseconds to make (if you count instantiation of the service,
instantiation of the port, and extra time taken the first time a method
on the port is called, it seems to be 200-800 ms, depending), and that
the spec doesn't guarantee that they're threadsafe (and as it happens,
i believe that in the JBossWS implementation, neither the service nor
the port is threadsafe).
Since you are using web services which is a pretty much standard way of
accessing business logic I would expect some prepackaged solutions to be
available.
So would i. I haven't come across any, though.
If not, you could wrap your client code in a JCA connector which then
will be pooled almost automatically by your application container
Man, it's all JCA today! This is something that would make a sensible
general-purpose tool, i suppose. How would you access it from application
code? Bind some kind of ServicePool into the JNDI namespace and look it
up? Or bind a PoolableService which gives out a different instance every
time it's looked up?
tom
--
If it ain't broke, open it up and see what makes it so bloody special.