[jboss-user] [JBoss Messaging] - Re: LocalTx, ClientTransaction leak?
do-not-reply at jboss.com
Wed Jan 9 15:03:31 EST 2008
This doesn't look right to me.
The only time that creating a connection, creating a session, doing something, then closing them is not an antipattern, is when you are using a JMS JCA resource adaptor.
This is because when using a resource adaptor, when you call createConnection() it doesn't actually create an actual new JMS connection, it just retrieves one from a pool that the resource adaptor maintains.
If you're not using a JCA resource adaptor then each call to createConnection, createSession etc will actually create new JMS connections, sessions etc.
Connections and Sessions are heavyweight objects and designed to be re-used. If this is the case then performance is going to very, very bad. Hence it's an antipattern.
If you're seeing lots of actual sessions created it would imply you're not actually using the JCA resource adaptor.
Can you confirm that the connections you create are created using the JCA JMS managed connection factory?
(This is the connection factory you get by looking up typically from java:/JmsXA)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118424#4118424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118424
More information about the jboss-user