Just close() your JMS connection at the end of your method call. The container will 
internally commit your transaction ( therefore it's container managed transaction :-) 

BTW: put all your connection/session.close() code into a finally block for avoiding 
memory leaks. Always catch exceptions and call ctx.setRollbackOnly() in such a case.

Connection rConnection = null;

try
{
     // get resources
     rConnection = ....

     // do the work
    .....
}
catch( Exception eEx )
{
    // rollback transaction (will be handled by container)
     ctx.setRollbackOnly();
}
finally
{
     // close resources (will internally commit transaction
     // if setRollbackOnly() has NOT been called )
     if( rConnection != null ) try{ rConnection.close(); } catch( Exception eIgnore) 
{};
}

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3822517#3822517

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3822517


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to