From 113406bdf414b8b73e94cb6f598a579040943b2b Mon Sep 17 00:00:00 2001 From: Jesse Seldess Date: Thu, 15 Nov 2018 12:27:33 -0500 Subject: [PATCH] Backport Java code sample fix to 2.0 --- _includes/v2.0/app/TxnSample.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/_includes/v2.0/app/TxnSample.java b/_includes/v2.0/app/TxnSample.java index e1be8197192..dd0851a56cf 100644 --- a/_includes/v2.0/app/TxnSample.java +++ b/_includes/v2.0/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(); }