This repository was archived by the owner on May 14, 2021. It is now read-only.
Feature/22 transaction support#23
Open
WojciechMazur wants to merge 4 commits intopropensive:furyfrom
Open
Conversation
WojciechMazur
commented
May 6, 2020
| val q"($arg) => $fnBody" = batch | ||
| //Using external context is a proof that provided Context.Batch was not sufficient to perform operation, though external (default) context was used | ||
| //Such construct could be considered as dirty hack, but I've not found better way to found usage of default context | ||
| val usesExternalContext = fnBody.exists(showCode(_).contains("Context.default")) |
Collaborator
Author
There was a problem hiding this comment.
This one is a bit dirty hack, but I've not found better solution to check at compile time if prohibited read operations were used.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces transactional operations using Mutatus as it is supported in Datastore.
It does not break backward compability due to introduction of
Contexts. Operations executed with default mode (not transactional or batched) are handled with implicitContext.DefaultIn case if all operations within transaction block would pass, transaction should be automatically commited, in other case whole transaction would be rolled back
Also changed return type of QueryBuilder.run() to
Stream[Result[T]]from previous
Result[Stream[Result[T]]]Using the same syntax is possible to execute Batch, using
Dao.batch(implicit batch => ..., which is write only operation. In case of using read operations withinbatchblock compile time error would be thrown.