You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by io42 <in...@desknetinc.com> on 2012/02/06 19:21:46 UTC

Using the PooledConnectionFactory programatically (no Spring implementation)

I'm trying to use the PooledConnectionFactoray to create a single connection
programatically that can be reused at various places in my application.  
http://activemq.2283324.n4.nabble.com/How-do-I-use-the-PooledConnectionFactory-tp2536577p2536874.html
This comment  says that wrapping a PooledConnectionFactory in a singleton
will defeat the purpose of using the PooledConnectionFactory, but I'm
uncertain as to why this is true.  Won't instantiating multiple
PooledConnectionFactory objects result in more than one Connection being
created? What am I missing?

--
View this message in context: http://activemq.2283324.n4.nabble.com/Using-the-PooledConnectionFactory-programatically-no-Spring-implementation-tp4362253p4362253.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: Using the PooledConnectionFactory programatically (no Spring implementation)

Posted by Gary Tully <ga...@gmail.com>.
u don't seem to be missing anything, a single factory and multiple
calls to createConnection/close will reuse a single connection.

On 6 February 2012 18:21, io42 <in...@desknetinc.com> wrote:
> I'm trying to use the PooledConnectionFactoray to create a single connection
> programatically that can be reused at various places in my application.
> http://activemq.2283324.n4.nabble.com/How-do-I-use-the-PooledConnectionFactory-tp2536577p2536874.html
> This comment  says that wrapping a PooledConnectionFactory in a singleton
> will defeat the purpose of using the PooledConnectionFactory, but I'm
> uncertain as to why this is true.  Won't instantiating multiple
> PooledConnectionFactory objects result in more than one Connection being
> created? What am I missing?
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Using-the-PooledConnectionFactory-programatically-no-Spring-implementation-tp4362253p4362253.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.



-- 
http://fusesource.com
http://blog.garytully.com