Does Java Connection.close rollback?

后端 未结 6 1133
别跟我提以往
别跟我提以往 2020-12-05 19:36

Does Java Connection.close rollback into a finally block?.

I know .Net SqlConnection.close does it.

With this I could make try/finally blocks without catch..

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 20:03

    According to the javadoc, you should try to either commit or roll back before calling the close method. The results otherwise are implementation-defined.

提交回复
热议问题