java - what happend with close connection before set AutoCommit true -
} { jdbcutil.close(rs, ps, conn); conn.setautocommit(true);
// right ? if this, cause problem connection can not released??
conn = jdbcutil.generateconn(); conn.setautocommit(false); logger.info("commit false"); rosdao.deletezlifnrrgt(jbxxbean.getname1(), conn); rosdao.deletezbp_prod_cat(jbxxbean.getname1(), conn); rosdao.deletezbp_pur_cat(jbxxbean.getname1(), conn);
// in 1 transaction more database dao, should close conn in every dao??? or close conn in parent function ??
if transaction open, closing connection abort without committing (rollback), , close connection usual.
if try change auto commit mode of closed connection exception thrown.
Comments
Post a Comment