400字范文,内容丰富有趣,生活中的好帮手!
400字范文 > jdbc事物回滚是否需要重新commit 不需要

jdbc事物回滚是否需要重新commit 不需要

时间:2020-06-21 12:42:38

相关推荐

jdbc事物回滚是否需要重新commit  不需要

....

Connectioncon=null;

Statementst=null;

try{

Class.forName("oracle.jdbc.driver.OracleDriver");

con=DriverManager.getConnection("...","...","...");

//设置事物处理

con.setAutoCommit(false);

st=ct.createStatement();

st.executeUpdate("update...");

st.executeUpdate("update...");

mit();

}catch(Exceptione){

con.rollback();

//回滚之后要不要再commit下?

e.printStackTrace();

}finally{

st.close();

con.close();

}

不需要

/topics/380024065

提交后回滚可以吗?解决方案

------解决方案--------------------------------------------------------1、虚拟机; 2、搭建e69da5e887aa3231313335323631343130323136353331333332636334测试环境; 3、先备份数据库,测试完再还原; ------解决方案--------------------------------------------------------看flashback功能开起来没有,开起来的话直接闪回就好了 ------解决方案--------------------------------------------------------flashback 或者冷备份 ------解决方案--------------------------------------------------------如果开了闪回就可以,没开的话 alter database flashback on; ------解决方案--------------------------------------------------------flashback ------解决方案--------------------------------------------------------

对于一个事物来说,你提交后就没有所谓的回滚了,只能在提交前回滚。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。