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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -