Skip to content
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

#58 - Add serverside JavaScript sample for MongoDB. #58

Closed
wants to merge 1 commit into from

Conversation

christophstrobl
Copy link
Member

Use a serverside script to simulate putIfAbsent.

@christophstrobl christophstrobl force-pushed the issue/mongodb-script-ops branch from ea62e60 to 41c5a44 Compare March 9, 2015 08:41
@christophstrobl christophstrobl force-pushed the issue/mongodb-script-ops branch from 41c5a44 to 9ecb1df Compare March 9, 2015 14:32
christophstrobl added a commit that referenced this pull request Mar 9, 2015
Use a serverside script to simulate putIfAbsent as contracted by the Map interface. The op will be atomic since mongoDB will put a lock on db until the script is finished.
@christophstrobl christophstrobl changed the title Add serverside JavaScript sample for MongoDB. #58 - Add serverside JavaScript sample for MongoDB. Mar 9, 2015
@odrotbohm
Copy link
Member

I wonder if the example gets a bit simpler if we remove the repositories from the mix here. putIfAbsent(…) is not a very repository-ish method actually and turning that bit of client code into a custom repository implementation could very well be just inside the test method. The aspect of working with a custom implementation inside a repository drags attention a bit away from the core concern of the example, doesn't it?

@christophstrobl christophstrobl force-pushed the issue/mongodb-script-ops branch from 9ecb1df to e4c94e4 Compare March 12, 2015 18:26
christophstrobl added a commit that referenced this pull request Mar 12, 2015
Use a serverside script to simulate putIfAbsent as contracted by the Map interface. The op will be atomic since mongoDB will put a lock on db until the script is finished.
@christophstrobl christophstrobl force-pushed the issue/mongodb-script-ops branch from e4c94e4 to 253a607 Compare March 12, 2015 18:34
christophstrobl added a commit that referenced this pull request Mar 12, 2015
Use a serverside script to simulate putIfAbsent as contracted by the Map interface. The op will be atomic since mongoDB will put a lock on db until the script is finished.
Use a serverside script to simulate putIfAbsent as contracted by the Map interface. The op will be atomic since mongoDB will put a lock on db until the script is finished.
@christophstrobl
Copy link
Member Author

thanks @olivergierke - moved the script into the tests and deleted the custom repository.

@odrotbohm odrotbohm force-pushed the master branch 2 times, most recently from fd38e72 to 19bb907 Compare April 14, 2015 19:42
christophstrobl added a commit that referenced this pull request Jul 16, 2015
Use a server-side script to simulate putIfAbsent(…) as contracted by the Map interface. The operation will be atomic since MongoDB will put a lock on database until the script is finished.
@odrotbohm
Copy link
Member

That's merged :).

@odrotbohm odrotbohm closed this Jul 16, 2015
@odrotbohm odrotbohm deleted the issue/mongodb-script-ops branch July 25, 2017 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants