Unverified Commit 8c98f76e authored by 张亮's avatar 张亮 Committed by GitHub
Browse files

Merge pull request #1149 from zhangkewei/dev

Fixed AbstractStatementAdapter.getUpdateCount return -1 when use orac…
parents 4196d4e0 e3681c97
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -111,10 +111,15 @@ public abstract class AbstractStatementAdapter extends AbstractUnsupportedOperat
        long result = 0;
        boolean hasResult = false;
        for (Statement each : getRoutedStatements()) {
            if (each.getUpdateCount() > -1) {
            /**
             * In oracle ojdbc driver, getUpdateCount can only be called once after a successful call.
             * Otherwise, this method return -1 by default.
             */
            int updateCount = each.getUpdateCount();
            if (updateCount > -1) {
                hasResult = true;
            }
            result += each.getUpdateCount();
            result += updateCount;
        }
        if (result > Integer.MAX_VALUE) {
            result = Integer.MAX_VALUE;