[jboss-user] [JCA/JBoss] - Discution about "Closing a connection for you" and Statefull

buggsbunny101 do-not-reply at jboss.com
Tue Jun 26 04:56:43 EDT 2007


Hello all,

I want to discuss about the "Closing a connection for you" and Stateful bean.

The ability to control if connection is not close is really useful, and should be keep since human write code (and can do mistake). 
But when using a container managed transaction in a stateful session bean, this feature is a problem. 
Effectively, if the treatment of the current bean need to be rolled back after many treatment, it's not possible since the connection have been closed after each treatment. We loose the interest of stateful bean!

I don't know how "Closing a connection for you" is managed and if it's really difficult to adapt it, but it can be useful to keep an association between the stateful bean and it's connection. So until the bean is open, the connection is keeped. At timeout, the connection is closed. Another way, certainly simple is to close connection when ejbClose is called! But closing the connection in a bean managed transaction context is a problem, no?

This will allow developper to use this feature and be informed that they forget to close connection. This also will ensure the safety of the server!



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

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



More information about the jboss-user mailing list