From the course: MongoDB Java Developer Associate Cert Prep

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Creating MongoDB transactions in Java applications

Creating MongoDB transactions in Java applications

From the course: MongoDB Java Developer Associate Cert Prep

Creating MongoDB transactions in Java applications

- Welcome. In this video, you'll learn how to create multi-document transactions in MongoDB for a Java application. A multi-document transaction is an operation that requires atomicity of reads and/or writes to multiple documents. A transaction is a sequence of database operations that represent a single unit of work. Once committed, all write operations performed under the protection of the transaction are saved. In the event that a transaction is canceled or doesn't complete successfully, all write operations performed during the transaction are discarded. Operations within a transaction succeed or fail together. This property is referred to as atomicity. Transactions also enable consistency, isolation, and durability of operations. These qualities together are known as asset compliant. Before we go through an example, let's review the steps to complete a transaction in a Java application. First, we start a client session. Next, we can define the transaction options, but this step…

Contents