Advanced OOP for WordPress: Customizing REST API Endpoints
How Blinkist Powers Millions of Users on MongoDB Atlas
AWS, Azure & Google Cloud Backup Solutions Compared
How to Automate App Deployment to Alibaba ECS with Mina
How to Set Up a Reverse NGINX Proxy on Alibaba Cloud
Seven Steps for Growth Hacking Your Business with Data
Setting up Your PyMongo Environment
Growing a Business Is About the Customer, Not the Product
How to Grow Your Business from $0 to $20M
Integrating MongoDB and Amazon Kinesis for Intelligent, Durable Streams
How to Set up a Secure Relational Database on Alibaba Cloud
How to Create Websites with Slides, a Developer-Friendly Tool
Power Your Business Applications with Elastic Compute Service
Adsense and AdWords - why use them?
Quickly Deploy WordPress & phpMyAdmin on Alibaba Cloud with ROS
WordPress Management Made Easy with the Plesk WordPress Toolkit
How to Deploy Apps Effortlessly with Packer and Terraform
Case Study: AO.com Builds Single Customer View with MongoDB
Three ways to grow your traffic and capture audience
Mobile Gaming: Build a Security Token Service with Object Storage Service
7 of the Best Code Playgrounds
3D Transformation Functions in CSS
Java and MongoDB 4.0 Support for Multi-document ACID Transactions
This article was originally published on MongoDB. Thank you for supporting the partners who make SitePoint possible.
MongoDB 4.0 adds support for multi-document ACID transactions.
But wait... Does that mean MongoDB did not support transactions until now? No, actually MongoDB has always supported transactions in the form of single document transactions. MongoDB 4.0 extends these transactional guarantees across multiple documents, multiple statements, multiple collections, and multiple databases. What good would a database be without any form of transactional data integrity guarantee?
Before we dive in this blog post, you can find all the code and try multi-document ACID transactions here.
Step 1: Start MongoDB
Start a single node MongoDB ReplicaSet in version 4.0.0 minimum on localhost, port 27017.
If you use Docker:
- You can use
- When you are done, you can use
- If you want to connect to MongoDB with the Mongo Shell, you can use
If you prefer to start mongod manually:
mkdir /tmp/data && mongod --dbpath /tmp/data --replSet rs
mongo --eval 'rs.initiate()'
Step 2: Start Java