Skip to content

Commit b07d57f

Browse files
committed
added a try/finally block for added safety during rollback
1 parent a191135 commit b07d57f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/java/org/apache/ibatis/executor/BaseExecutor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,13 @@ public void commit(boolean required) throws SQLException {
159159

160160
public void rollback(boolean required) throws SQLException {
161161
if (!closed) {
162-
clearLocalCache();
163-
flushStatements();
164-
if (required) {
165-
transaction.rollback();
162+
try {
163+
clearLocalCache();
164+
flushStatements();
165+
} finally {
166+
if (required) {
167+
transaction.rollback();
168+
}
166169
}
167170
}
168171
}

0 commit comments

Comments
 (0)