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)

http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossJMSRA

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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to