liveBook · Manning

Database transaction

A database transaction is a logical unit of database operations whose changes are committed together or rolled back as a whole.

How 14 Manning books explain it

Java Persistence with Spring Data and Hibernate epub

A transaction is a database unit of work whose operations are handled as a coherent atomic interaction.

How it is used
Defines atomic database work and boundaries for concurrent units of work.
How deep it goes
Works through demarcation, rollback, flushing, isolation, and Spring configuration while focusing on transactions spanning one database.
Examples
Uses auction completion, an EntityManager transaction pattern, and rollback-by-default transactional tests.
What you can do after
Apply it via JPA EntityManager or Spring @Transactional to delimit work and control rollback.

Read how Java Persistence with Spring Data and Hibernate epub explains database transaction →

The Joy of JavaScript

A book-local transaction object in the blockchain domain that models a transfer record and related behavior.

How it is used
Models a transfer record in a simplified blockchain application and anchors examples of JavaScript object design.
How deep it goes
Works through object construction and composable behavior, but defers cryptographic hash internals and key handling.
Examples
Uses a coffee payment, prototype-linked transfer objects, constructor functions, and a Transaction instance assembled with mixins.
What you can do after
Build it from scratch as a JavaScript transfer object and compose its hashing, signing, and validation interfaces.

Read how The Joy of JavaScript explains database transaction →

Think Distributed Systems

A transaction is a logical unit of work whose operations are treated as a single coherent execution with specified correctness properties.

How it is used
Uses transactions to make concurrent, failure-prone applications appear correct and complete without visible coordination logic.
How deep it goes
Defines ACID and serializability, explains concurrency and failure scenarios, and stops short of implementation internals.
Examples
Uses money transfers, concurrent balance updates, failed multi-write operations, SQL constraints, and single- versus multi-resource-manager execution.
What you can do after
Evaluate/understand how transactions provide atomicity, correctness, and completeness under concurrency and failure.

Read how Think Distributed Systems explains database transaction →

Unit Testing Principles, Practices, and Patterns

A database transaction is a sequence of database operations treated as a single unit that can be committed or rolled back.

How it is used
Governs related database mutations in production and supports close-to-production integration testing.
How deep it goes
Explains atomicity, connection boundaries, shared transactions, unit of work, and test isolation, stopping short of database-engine internals.
Examples
Uses a CRM ChangeEmail operation, shared repositories, Entity Framework context reuse, and startup database cleanup.
What you can do after
Apply database transactions and units of work to keep business mutations atomic and design integration tests without production-divergent transaction wrappers.

Read how Unit Testing Principles, Practices, and Patterns explains database transaction →

100 SQL Server Mistakes and How to Avoid Them

A database transaction is a logical unit of work whose operations are committed or rolled back as a group.

How it is used
Protects related sales-order updates from being committed only partially when an error occurs.
How deep it goes
Defines ACID properties and demonstrates open-transaction diagnosis, rollback, TRY...CATCH, and transaction-log consequences.
Examples
Uses an InsertSalesOrder procedure, a renamed detail table, constraint failures, error messages, and batched deletion guidance.
What you can do after
Diagnose/debug with it by detecting an open transaction and rolling it back after a failed procedure.

Read how 100 SQL Server Mistakes and How to Avoid Them explains database transaction →

.NET in Action, Second Edition

A transaction is a database operation boundary whose changes are committed together or discarded together to prevent partial completion.

How it is used
Protects related account-balance updates from partial completion when an operation or its surrounding infrastructure fails.
How deep it goes
Works through separate saves, a failing test, explicit commit and rollback, change-tracker cleanup, and transaction-aware retry.
Examples
Uses a C# account-transfer repository, an insufficient-funds test, and EF Core transaction-helper listings.
What you can do after
Apply it via EF Core to commit or roll back account updates together and account for retries after uncertain commits.

Read how .NET in Action, Second Edition explains database transaction →

MongoDB 8.0 in Action, Third Edition

A transaction is a group of database operations committed as one unit or rolled back so that partial execution is not persisted.

How it is used
Coordinates related MongoDB reads and writes when a change spans documents and partial updates would be unacceptable.
How deep it goes
Works through session setup, commit or abort, retries, and driver callbacks, then gives operational limits and restrictions.
Examples
Uses a flight-and-hotel booking and account, customer, and transaction-record updates implemented in mongosh and driver listings.
What you can do after
Apply it via mongosh or MongoDB driver Callback APIs to commit coordinated writes and handle failures.

Read how MongoDB 8.0 in Action, Third Edition explains database transaction →

Building Web APIs with ASP.NET Core

A unit of work is a pattern that tracks objects affected by a business transaction and coordinates persisting their changes and resolving concurrency problems.

How it is used
Frames DbContext usage as one application-level unit of work per HTTP request/response lifecycle.
How deep it goes
Defines unit-of-work responsibilities and traces a read request, but does not detail write coordination or concurrency-resolution implementation.
Examples
Uses BoardGamesController, ApplicationDbContext, the BoardGames query, and ToArray() to demonstrate request-scoped retrieval.
What you can do after
Apply it via ASP.NET Core dependency injection by querying a database through a controller’s ApplicationDbContext.

Read how Building Web APIs with ASP.NET Core explains database transaction →

Quarkus in Action

A transaction is a logical unit of work whose operations are coordinated to satisfy defined consistency and completion guarantees.

How it is used
Coordinates database writes in Quarkus services so entity changes can reach the database.
How deep it goes
Explains boundaries, propagation choices, manual APIs, and flush behavior, but does not develop distributed transaction processing.
Examples
Uses GraphQL inventory mutations, gRPC persistence callbacks, and QuarkusTransaction wrapper code.
What you can do after
Apply it via @Transactional or QuarkusTransaction to give database writes an appropriate boundary.

Read how Quarkus in Action explains database transaction →

Django in Action

A database transaction is an atomic group of database actions that either completes as a unit or can be rolled back as a unit.

How it is used
Isolates Django database tests so each method starts from a predictable state.
How deep it goes
Explains atomic grouping and automatic rollback within Django tests, without detailing broader application-level transaction management.
Examples
Uses a Musician fixture and a client request to test status, response context, and rendered content.
What you can do after
Diagnose test isolation by creating ORM fixtures, exercising views, checking responses, and relying on rollback between methods.

Read how Django in Action explains database transaction →

Build Python Web Apps with Streamlit

A database transaction is an atomic unit of database work whose modifications remain provisional until committed or are discarded by rollback.

How it is used
Uses transactions to make database writes permanent only after explicit confirmation and to protect failed writes from leaving temporary changes.
How deep it goes
Explains transactions through SQLAlchemy sessions, commit, rollback, and exception handling without detailing isolation levels or concurrency.
Examples
Demonstrates a Streamlit haiku application that commits successful write queries and rolls them back after errors.
What you can do after
Operate a SQLAlchemy-backed Streamlit database layer that commits successful writes and rolls back failed write operations.

Read how Build Python Web Apps with Streamlit explains database transaction →

API Design Patterns

Transactional semantics are execution rules in which multiple data changes are committed together or rolled back together as one unit.

How it is used
Coordinates multi-resource changes, especially copy, move, and dependent API updates.
How deep it goes
Explains atomicity, snapshots, rollback, concurrency, and API limitations without detailing transaction implementation internals.
Examples
Uses resource copying, resource moving, and ChatRoom logging configuration updates as concrete cases.
What you can do after
Evaluate when multi-resource operations require atomic or transaction-like semantics to avoid partial success.

Read how API Design Patterns explains database transaction →

Build and Orchestrator in Go (From Scratch)

A database transaction is an operation context that provides a consistent view of database data while applying reads or writes.

How it is used
Uses transactions to provide consistent reads and safely modify persistent task data.
How deep it goes
Explains transaction types, callback APIs, bucket access, iteration, error handling, and read-write operations through store methods.
Examples
Demonstrates task counting, retrieval, listing, bucket creation, and JSON-backed insertion in a persistent task store.
What you can do after
Apply it via BoltDB to implement consistent reads and writes for a persistent task store.

Read how Build and Orchestrator in Go (From Scratch) explains database transaction →

Learn Haskell by Example

A database transaction is a sequence of operations treated as one atomic unit that can be committed or rolled back.

How it is used
Protects database updates from failures while adding and updating todo entries.
How deep it goes
Explains the BEGIN, action, COMMIT, and ROLLBACK sequence and stops short of broader transaction management.
Examples
Uses todo-entry insertion, duplicate IDs, last-inserted row IDs, and checked-field updates as concrete cases.
What you can do after
Apply it via Database.SQLite.Simple to commit grouped actions or roll them back after exceptions.

Read how Learn Haskell by Example explains database transaction →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.