You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "O'Shea, Sean" <Se...@fmr.com> on 2008/01/07 20:30:39 UTC

[commons-pool] Upgrade Question

Hi there,

I've recently updated some of my code to use the 1.3 version of
commons-pool. I was previously using a 1.2 version of commons-pool. I
have a class which looks like this:

class PoolHolder extends GenericObjectPool {

    public PoolHolder(ConnectionHolderFactory factory, int maxActive,
            byte whenExhaustedAction, long maxWait, int maxIdle,
            boolean testOnBorrow, boolean testOnReturn, int reapTime,
            boolean testWhileIdle) {
        super(factory,
                maxActive,
                whenExhaustedAction,
                maxWait,
                maxActive,
                0,
                testOnBorrow,
                testOnReturn,
                reapTime,
                0,
                -1,
                true);

}

http://issues.apache.org/bugzilla/show_bug.cgi?id=33264 &
http://issues.apache.org/bugzilla/show_bug.cgi?id=36904 state that the
GenericObjectPool prior to version 1.3 was in fact a LIFO implementation
despite the fact that the documentation stated that it was FIFO. These
bugzilla bugs have been marked as fixed which gives me the impression
that the GenericObjectPool is now a FIFO implementation.

I want to continue to have my PoolHolder class be a LIFO implementation
and I want to use the 1.3 version of commons-pool. Does this mean that I
have to change my class to extend from the StackedObjectPool and remove
references to GenericObjectPool?

Just wanted to check with the community before going ahead with any code
changes on my side.

Cheers

Sean O Shea

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


RE: [commons-pool] Upgrade Question

Posted by "O'Shea, Sean" <Se...@fmr.com>.
Sounds good Mark - thanks for the information. 

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Monday, January 07, 2008 6:03 PM
To: Jakarta Commons Users List
Subject: Re: [commons-pool] Upgrade Question

O'Shea, Sean wrote:
> Changing my code is not such a big issue. For example, if I had to
> change my class to look like this (extending from StackObjectPool),
> would I be ok:
I don't think so since most of those attributes aren't available.


> Are there any plans to support these properties for
> a LIFO implementation? Will these properties be available in a LIFO
> implementation in the 1.4 version of commons-pool?
Yes and yes. You can do all of this with GenericObjectPool in 1.4

> If I upgrade to the 1.3 version of commons-pool and continue to have
my
> PoolHolder extend from the GenericObjectPool, will my implementation
> change from a LIFO to a FIFO?
Yes.

Mark


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



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


Re: [commons-pool] Upgrade Question

Posted by Mark Thomas <ma...@apache.org>.
O'Shea, Sean wrote:
> Changing my code is not such a big issue. For example, if I had to
> change my class to look like this (extending from StackObjectPool),
> would I be ok:
I don't think so since most of those attributes aren't available.


> Are there any plans to support these properties for
> a LIFO implementation? Will these properties be available in a LIFO
> implementation in the 1.4 version of commons-pool?
Yes and yes. You can do all of this with GenericObjectPool in 1.4

> If I upgrade to the 1.3 version of commons-pool and continue to have my
> PoolHolder extend from the GenericObjectPool, will my implementation
> change from a LIFO to a FIFO?
Yes.

Mark


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


RE: [commons-pool] Upgrade Question

Posted by "O'Shea, Sean" <Se...@fmr.com>.
Thanks for the reply Mark,

Unfortunately I cannot really wait. This is a bit of a pressing matter
for me. No pressure on finishing the 1.4 version - I just need some
clarification on the 1.3 version and how it impacts my code.

Changing my code is not such a big issue. For example, if I had to
change my class to look like this (extending from StackObjectPool),
would I be ok:

class PoolHolder extends StackObjectPool {

    public PoolHolder(ConnectionHolderFactory factory, int maxActive,
            byte whenExhaustedAction, long maxWait, int maxIdle,
            boolean testOnBorrow, boolean testOnReturn, int reapTime,
            boolean testWhileIdle) {
        super(factory,
                maxActive,
                whenExhaustedAction,
                maxWait,
                maxActive,
                0,
                testOnBorrow,
                testOnReturn,
                reapTime,
                0,
                -1,
                true);

}

However, StackObjectPool doesn't have this constructor (and I'm not sure
there are plans to introduce this constructor as it appears that some of
the properties that I need [testOnBorrow, testOnReturn, reapTime etc]
are not supported). Are there any plans to support these properties for
a LIFO implementation? Will these properties be available in a LIFO
implementation in the 1.4 version of commons-pool?

If I upgrade to the 1.3 version of commons-pool and continue to have my
PoolHolder extend from the GenericObjectPool, will my implementation
change from a LIFO to a FIFO?

Thanks again for your help

Sean

-----Original Message-----
From: Mark Thomas [mailto:markt@apache.org] 
Sent: Monday, January 07, 2008 4:44 PM
To: Jakarta Commons Users List
Subject: Re: [commons-pool] Upgrade Question

O'Shea, Sean wrote:
> I want to continue to have my PoolHolder class be a LIFO
implementation
> and I want to use the 1.3 version of commons-pool. Does this mean that
I
> have to change my class to extend from the StackedObjectPool and
remove
> references to GenericObjectPool?
> 
> Just wanted to check with the community before going ahead with any
code
> changes on my side.

If you can wait a short while, there will be a 1.4 release with a bunch
of 
fixes including one that reverts LIFO by default and makes LIFO/FIFO 
configurable.

Mark


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


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


Re: [commons-pool] Upgrade Question

Posted by Mark Thomas <ma...@apache.org>.
O'Shea, Sean wrote:
> I want to continue to have my PoolHolder class be a LIFO implementation
> and I want to use the 1.3 version of commons-pool. Does this mean that I
> have to change my class to extend from the StackedObjectPool and remove
> references to GenericObjectPool?
> 
> Just wanted to check with the community before going ahead with any code
> changes on my side.

If you can wait a short while, there will be a 1.4 release with a bunch of 
fixes including one that reverts LIFO by default and makes LIFO/FIFO 
configurable.

Mark


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