-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add transaction support #1904
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
Closed
Closed
Add transaction support #1904
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
e54408a
add transaction support, requires mongodb version V4.0 or more and de…
klinson 9a01d23
format code
klinson 64b4156
add mongodb(replica set) environment into docker configuration
klinson 34b1a98
must be compatible with Illuminate\Database\Connection::rollBack($toL…
klinson 84850a9
add transaction usage into readme.md
klinson bedaaa8
update .travis.yml
klinson b030914
update database.conf
klinson 163b41d
update .travis.yml
klinson 92c1e07
update docker-compose.yml
klinson caa61ea
Update src/Jenssegers/Mongodb/Connection.php
klinson 7d96c3e
fixbug Connection.php
klinson 776492d
Merge remote-tracking branch 'remotes/upstream/master'
klinson 10bda05
add transaction into README.md
klinson 85a0be8
add replset mongodb tag
klinson b39251c
Remove travis from PR please
klinson fe61056
remove author tag and comments in Chinese language
klinson 3029e36
improved function docblocks of transaction
klinson 4ce523f
merge update
klinson 44cb7a7
Merge remote-tracking branch 'upstream/master'
klinson 7221417
add another testsuite for transactional tests in phpunit.xml
klinson 1b90047
optimized code
klinson a5d0858
update ci and tests configs
klinson add9516
update tests configs
klinson 14b3ad7
update tests configs
klinson 0c22e4a
update ci.yml
klinson 0b840db
update tests
klinson cf88a03
update tests
klinson 2664bd5
update tests
klinson 44bd081
update tests
klinson 850d034
Merge branch 'master' into master
klinson 83f45c9
delete links of docker-compose.yaml
klinson 5eb6f42
Merge remote-tracking branch 'origin/master'
klinson 84186f1
Merge branch 'master' into master
divine 7741acb
optimize code
klinson 72dbdcb
Merge remote-tracking branch 'origin/master'
klinson c14bd44
Merge branch 'master' into master
divine 5773597
Merge branch 'master' into master
divine 9e0cfd2
Merge branch 'master' into master
divine b2d1740
Merge branch 'master' into master
divine 8cc01d5
Merge branch 'master' into master
klinson dafee61
remove testInsertWithId
klinson 0fd27ba
update build-ci.yml
klinson 6e89c8b
add return info to phpdoc
klinson 5645fc7
format code
klinson 9cd8bb2
update README.md
klinson 551c184
Merge remote-tracking branch 'upstream/master'
klinson 49307e2
remove excess $option
klinson 59020fb
divide testUpdate on two methods testUpdateWithRollback and testUpda…
klinson 97f9b4b
update ci part
klinson 9c90125
update ci part
klinson 041d02b
Merge remote-tracking branch 'upstream/master'
klinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add mongodb(replica set) environment into docker configuration
- Loading branch information
commit 64b415611a41c1531c5fdf2773224bc75268fab6
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM mongo | ||
|
||
ADD mongo-replset-init.sh /usr/local/bin/ | ||
|
||
RUN chmod +x /usr/local/bin/mongo-replset-init.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
echo "prepare rs initiating" | ||
|
||
check_db_status() { | ||
mongo1=$(mongo --host mongo1 --port 27017 --eval "db.stats().ok" | tail -n1 | grep -E '(^|\s)1($|\s)') | ||
mongo2=$(mongo --host mongo2 --port 27017 --eval "db.stats().ok" | tail -n1 | grep -E '(^|\s)1($|\s)') | ||
mongo3=$(mongo --host mongo3 --port 27017 --eval "db.stats().ok" | tail -n1 | grep -E '(^|\s)1($|\s)') | ||
if [[ $mongo1 == 1 ]] && [[ $mongo2 == 1 ]] && [[ $mongo3 == 1 ]]; then | ||
init_rs | ||
else | ||
check_db_status | ||
fi | ||
} | ||
|
||
init_rs() { | ||
ret=$(mongo --host mongo1 --port 27017 --eval "rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'mongo1:27017' }, { _id: 1, host: 'mongo2:27017' }, { _id: 2, host: 'mongo3:27017' } ] })" > /dev/null 2>&1) | ||
} | ||
|
||
check_db_status > /dev/null 2>&1 | ||
|
||
echo "rs initiating finished" | ||
exit 0 |
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.