-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add detailed comment for allowNestedTransaction(), make test names cl…
…earer
- Loading branch information
Showing
2 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,5 +74,22 @@ interface TransactionCallable<T> { | |
*/ | ||
Timestamp getCommitTimestamp(); | ||
|
||
/** | ||
* Allows overriding the default behaviour of blocking nested transactions. | ||
* | ||
* Note that the client library does not maintain any information regarding the nesting structure. | ||
* If an outer transaction fails and an inner transaction succeeds, upon retry of the outer | ||
* transaction, the inner transaction will be re-executed. | ||
* | ||
* Use with care when certain that the inner transaction is idempotent. Avoid doing this when | ||
* accessing the same db. There might be legitimate uses where access need to be made across DBs | ||
* for instance. | ||
* | ||
* E.g. of nesting that is discouraged, see {@code nestedReadWriteTxnThrows} | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nithinsujir
|
||
* {@code nestedReadOnlyTxnThrows}, {@code nestedBatchTxnThrows}, | ||
* {@code nestedSingleUseReadTxnThrows} | ||
* | ||
* @return this object | ||
*/ | ||
TransactionRunner allowNestedTransaction(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 comments
on commit 72409fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review. Looks a lot better than my first change.
@pongad PR is now ready to be merged.
Not sure if we want to reference our tests in code comments.