This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Hi, according to the Java coding conventions, isn't it appropriate to use the commit() or rollback() in a finally block? Please see the following code which is a portion of my program. Please let me know is it appropriate.
In your code you risk leaving the connection hanging if any exception is encountered during commit() or rollback(). I'd probably put the rollback() in the catch block and the commit() last in the original try block, like so:
Admit nothing. Blame everyone. Be bitter.
Joined: Feb 23, 2006
Thank you so much for the response. Now I understand the flow of how to do this! -JEAN