Skip to content

Commit

Permalink
Fix local transaction auto commit in jdbc adapter.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhucong committed Jan 25, 2024
1 parent d6d1079 commit 416017a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,16 @@ private void beginDistributedTransaction() throws SQLException {

/**
* Handle auto commit.
*
*
* @throws SQLException SQL exception
*/
public void handleAutoCommit() throws SQLException {
if (!autoCommit && TransactionType.isDistributedTransaction(databaseConnectionManager.getConnectionTransaction().getTransactionType())
&& !databaseConnectionManager.getConnectionTransaction().isInTransaction()) {
beginDistributedTransaction();
if (!autoCommit && !databaseConnectionManager.getConnectionTransaction().isInTransaction()) {
if (TransactionType.isDistributedTransaction(databaseConnectionManager.getConnectionTransaction().getTransactionType())) {
beginDistributedTransaction();
} else {
getConnectionContext().getTransactionContext().setInTransaction(true);
}
}
}

Expand Down

0 comments on commit 416017a

Please sign in to comment.