Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions _includes/v2.1/app/TxnSample.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}
Expand Down