About Jave Transaction commit and rollback issues under Oracle Drive

Source: Internet
Author: User

All along, it is assumed that connection if Setautocommit (false) is set, the manual transaction commit must be initiated manually or rollback. There was a problem today and the results were very surprising.

The results were tested as follows (note that under Oracle drivers, other environments are unknown):

1, set the Setautocommit (false) after performing the subsequent DML data update operation, did not explicitly manually commit or rollback, finally set Setautocommit (true), after closing the connection, the default submission succeeds.

2, set the Setautocommit (false) after performing the subsequent DML data update operation, the execution of two SQL updates, intermediate Rollback, the first part of the rollback, the second part does not explicitly manually commit, default commit.

3, set the Setautocommit (false) after performing the subsequent DML data update operation, did not explicitly manually commit or rollback, and finally did not set Setautocommit (true), close the connection, the default submission succeeds.


Summary: When Setautocommit (false) is set, the default commit is not specified unless explicitly rollback, without any explicit commit or rollback, setting the setting Setautocommit (true) or closing the connection. The previous transaction will also be submitted by default.


About Jave Transaction commit and rollback issues under Oracle Drive

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.