diff --git a/_includes/v2.1/app/TxnSample.java b/_includes/v2.1/app/TxnSample.java index e1be8197192..dd0851a56cf 100644 --- a/_includes/v2.1/app/TxnSample.java +++ b/_includes/v2.1/app/TxnSample.java @@ -75,6 +75,7 @@ public static void retryTransaction(Connection conn, RetryableTransaction tx) tx.run(conn); releaseAttempted = true; conn.releaseSavepoint(sp); + break; } catch(SQLException e) { String sqlState = e.getSQLState(); @@ -83,14 +84,12 @@ public static void retryTransaction(Connection conn, RetryableTransaction tx) if(sqlState.equals("40001")) { // Signal the database that we will attempt a retry. conn.rollback(sp); - continue; } else if(releaseAttempted) { throw new AmbiguousCommitException(e); } else { throw e; } } - break; } conn.commit(); }