-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch transaction #5849
Batch transaction #5849
Conversation
aca4e49
to
142acde
Compare
Codecov Report
@@ Coverage Diff @@
## master #5849 +/- ##
=========================================
+ Coverage 93.67% 93.7% +0.03%
=========================================
Files 153 153
Lines 10636 10708 +72
=========================================
+ Hits 9963 10034 +71
- Misses 673 674 +1
Continue to review full report at Codecov.
|
@dplewis sorry for flooding you with so many commits in this PR. It is actually working, but MongoDB only supports transactions when running version >4 in a wiredTiger replicaset. I am trying to figure out how to setup this environment in Travis. I will let you know then. |
No problem take your time. I know this is a highly requested feature. |
5fa15c9
to
dd214be
Compare
}; | ||
let initialPromise = Promise.resolve(); | ||
if (req.body.transaction === true) { | ||
initialPromise = req.config.database.createTransactionalSession(); |
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.
Good job getting this one in. I can't wait to use it.
Can you add this to direct access?
https://github.com/parse-community/parse-server/blob/master/src/ParseServerRESTController.js
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.
done
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!
* Batch transaction boilerplate * Refactoring transaction boilerplate * Independent sessions test * Transactions - partial * Missing only one test * All tests passing for mongo db * Tests on Travis * Transactions on postgres * Fix travis to restart mongodb * Remove mongodb service and keep only mongodb runner * MongoDB service back * Initialize replicaset * Remove mongodb runner again * Again only with mongodb-runner and removing cache * Trying with pretest and posttest * WiredTiger * Pretest and posttest again * Removing inexistent scripts * wiredTiger * One more attempt * Trying another way to run mongodb-runner * Fixing tests * Include batch transaction on direct access * Add tests to direct access
Guys this is great work! Any plans to make it accessible from the JS SDK and the remaning SDKs soon? Can I help with that? |
Yes. There is an open PR (parse-community/Parse-SDK-JS#1090) that we are working on. |
This PR empowers the current Parse Server's
/batch/
endpoint with transaction capability for both MongoDB (>4.0) and Postgres. You can find an example of request below:Close #2159