Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
211010717
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2021
211010717
Commits
ce41bce9
Unverified
Commit
ce41bce9
authored
4 years ago
by
陈健斌
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bugfix: fix repeated commit when autocommit is false (#3040)
parent
da0e25bd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rm-datasource/src/main/java/io/seata/rm/datasource/ConnectionProxy.java
+4
-1
4 additions, 1 deletion
...src/main/java/io/seata/rm/datasource/ConnectionProxy.java
with
4 additions
and
1 deletion
rm-datasource/src/main/java/io/seata/rm/datasource/ConnectionProxy.java
+
4
−
1
View file @
ce41bce9
...
...
@@ -185,6 +185,9 @@ public class ConnectionProxy extends AbstractConnectionProxy {
return
null
;
});
}
catch
(
SQLException
e
)
{
if
(
targetConnection
!=
null
&&
!
getAutoCommit
())
{
rollback
();
}
throw
e
;
}
catch
(
Exception
e
)
{
throw
new
SQLException
(
e
);
...
...
@@ -251,7 +254,7 @@ public class ConnectionProxy extends AbstractConnectionProxy {
@Override
public
void
setAutoCommit
(
boolean
autoCommit
)
throws
SQLException
{
if
(
autoCommit
&&
!
getAutoCommit
())
{
if
(
(
context
.
inGlobalTransaction
()
||
context
.
isGlobalLockRequire
())
&&
autoCommit
&&
!
getAutoCommit
())
{
// change autocommit from false to true, we should commit() first according to JDBC spec.
doCommit
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment