Skip to content

Commit

Permalink
[APIS-885] Change auto_commit mode to false when starting a distribut…
Browse files Browse the repository at this point in the history
…ed transaction (#25)

http://jira.cubrid.org/browse/APIS-885

When using distributed transaction, rollback does not work, so data is entered into the DB.
In a distributed transaction, commit and rollback should be performed only through XAResource.
  • Loading branch information
airnet73 committed Nov 19, 2021
1 parent 902269e commit dda6d38
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/jdbc/cubrid/jdbc/driver/CUBRIDConnectionWrapperXA.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ void xa_start(UConnection u) {
if (u != null) {
u_con = u;
u_con.setCUBRIDConnection(this);
u_con.setAutoCommit(auto_commit);
}
}

Expand All @@ -138,5 +139,6 @@ void xa_end(UConnection u) {
xa_started = false;
if (u != null) u_con = u;
auto_commit = true;
u_con.setAutoCommit(auto_commit);
}
}

0 comments on commit dda6d38

Please sign in to comment.