Skip to content

Commit 01554fa

Browse files
author
Jesse Seldess
authored
Merge pull request #4050 from cockroachdb/backport-java-fix
Backport Java code sample fix to 2.0
2 parents aabfd7b + 113406b commit 01554fa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

_includes/v2.0/app/TxnSample.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public static void retryTransaction(Connection conn, RetryableTransaction tx)
7575
tx.run(conn);
7676
releaseAttempted = true;
7777
conn.releaseSavepoint(sp);
78+
break;
7879
}
7980
catch(SQLException e) {
8081
String sqlState = e.getSQLState();
@@ -83,14 +84,12 @@ public static void retryTransaction(Connection conn, RetryableTransaction tx)
8384
if(sqlState.equals("40001")) {
8485
// Signal the database that we will attempt a retry.
8586
conn.rollback(sp);
86-
continue;
8787
} else if(releaseAttempted) {
8888
throw new AmbiguousCommitException(e);
8989
} else {
9090
throw e;
9191
}
9292
}
93-
break;
9493
}
9594
conn.commit();
9695
}

0 commit comments

Comments
 (0)