Let's suppose that I have this method:
public void doUpdate() throws SQLException
{
java.sql.Connection conn;
java.sql.Statement stmt;
conn = getConnectionFromXADataSource();
// ...
stmt.executeUpdate(strSQLUpdate);
// ...
conn.close();
}
Also, suppose that "doUpdate" is executing in a JTA transaction:
public void processRequest()
{
UserTransaction tx;
// ...
tx.begin();
doUpdate();
tx.commit();
}
Does conn.close() interfere with the JTA transaction?
Should I remove "conn.close()" from doUpdate?
Would it be better for me to call conn.close() after
I call tx.commit() ?
http://java.sun.com/products/jta/ http://java.sun.com/products/jdbc/