Minerva Pools seems that can be used not only for jdbc connections, or
datasource,
but also for other resources (also not pool aware, where the prepare method
of the corresponding ObjectPoolFactory instance will handle it).
As you say (and i understand) closing a resource when an error is detected
by the pool
(automatically) without developer interaction seems that is not a good idea
(for me).
Instead providing to developer an api to inform pool that "look get this
resource back,
and don't use it again" seems better.
In my case i did not create a Pool subclass because it seems that Pool class
is
good enough. If somebody also adds this feature to the Pool i think it will
be better.
This can be implemented through many different ways. e.g.
1) Mark this resource as "used" and let the GC release it.
2) Release it immediatly.
We can also add an dummy "test" resource in the PoolObjectFactory that will
be called
in Pool's getObject(). If it returns null or throws an exception then
resource is not returned
to the user and release it (immediatly or by GC).
Another question if you can help me is:
Can i test my Socket pool direct from a client program?
I have build an test where i get the context but i can't get the bounded
instance,
i get a null pointer from Naming Service. (Pool is tested by adding and
closing 2 connections
in the SocketPoolMBean instance).
Thanks
Stratis.
> -----Original Message-----
> From: Aaron Mulder [SMTP:[EMAIL PROTECTED]]
> Sent: �������, 12 ������� 2000 17:30
> To: jBoss
> Subject: RE: [jBoss-User] When a pooled resource can't be reused ?
>
> That's a good point. I was kicking around the idea of closing an
> object any time an error was detected. This would be somewhat inefficient
> if you have lots of errors caused by bad SQL or bad host names or whatever
> as opposed to connections timing out, but presumably you would correct
> that sort of thing before deploying. Would that be a good solution for
> you? Or do you really need manual control over when to close objects
> "permanently"?
>
> Aaron
>
> On Wed, 12 Jul 2000, ARAVIAS EFSTRATIOS wrote:
> > I have build some kind of socket pooling that seems to work,
> > based on the ObjectPool in miverva package.
> > My question now is if the developer detects that the pooled
> > resource that he has is no more functional (e.g. Underlying connection
> > is closed) how can he inform the pool that this resource should not
> > be reused again?
> >
> > I looked in ObjectPool and there is no function for releasing and object
> > permantly. I can of course always create a subclass of ObjectPool,
> > but i think that this functionality should be included in ObjectPool.
> > e.g. releaseObjectPermantly()
> > and also in objectError() we can use this function.
> > Another perhaps simpler solution is to modify the prepareObject in the
> > PoolObjectFactory
> > abstract class so that it throws an exception. This gives the ability to
> the
> > developer to test the underlying connection before returning it to the
> > client and throw
> > an exception if it is not ok.
> >
> > Thanks
> > Stratis
> >
> >
> >
> >
> > --
> > --------------------------------------------------------------
> > To subscribe: [EMAIL PROTECTED]
> > To unsubscribe: [EMAIL PROTECTED]
> > Problems?: [EMAIL PROTECTED]
> >
>
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]