What a four-operation failure taught me about commits, cancellation reasons, and verifying that nothing was written.
A database transaction is easy to appreciate when it succeeds. The more important question is what happens when one operation fails after several other changes have been requested.
Suppose an application needs to create a record, update an existing balance, and delete an obsolete item. If a final validation check fails, none of those changes should be committed. Otherwise, the application could be left with data that describes a transaction that never actually completed.
I tested this behavior using Tables by ServerlessCreed and Amazon DynamoDB. The experiment had three parts: commit a valid transaction, deliberately fail the final condition in a second transaction, and correct the request before verifying the committed state independently with the AWS CLI.
The test used Tables v3.3.46, a disposable DynamoDB table in us-east-1, and on-demand capacity. The data below is synthetic test data.
Prerequisites
To reproduce this workflow, you need:
- Tables by ServerlessCreed installed, with access to Operations Studio → Transaction Builder.
- An approved, non-production AWS environment with an active DynamoDB connection configured in Tables.
- An AWS profile with the required DynamoDB read and transaction permissions.
- A disposable DynamoDB table for safely testing transaction operations.
- AWS CLI installed and configured for independent verification of the results.
For this test, I used:
| Component | Configuration |
|---|---|
| Tables version | v3.3.46 |
| Operating system | Windows 11 |
| AWS Region |
us-east-1 (N. Virginia) |
| AWS profile | admin-profile |
| Test table | TC_ADV_001_QA |
| Billing mode | On-demand |
| Verification | Tables and AWS CLI |
| Testing approach | Successful transaction, deliberate failure, cancellation analysis, and recovery |
Starting with a known state
I began with three items in an isolated table. The id attribute was the String partition key, and version was a Number used for optimistic checks.
| Item | Balance | Version | Status |
|---|---|---|---|
ADV-001 |
100 | 1 | ACTIVE |
ADV-002 |
50 | 1 | ACTIVE |
ADV-GUARD |
0 | 1 | READY |

Figure 1. Baseline records before running any transaction.
Having an explicit baseline made it possible to distinguish a committed change from a partial write or a stale result.
A valid transaction: all changes commit
I opened Operations Studio → Transaction Builder, selected TransactWrite, and configured three actions against distinct items:
-
Update
ADV-001: Changebalancefrom 100 to 90 andversionfrom 1 to 2, provided its existing version is 1. -
Put
ADV-NEW: Create a new item with balance 10, version 1, and statusCREATED, provided it does not already exist. -
ConditionCheck
ADV-GUARD: Require statusREADYand version 1.
The update used the expression:
SET #b = :newBalance, #v = :newVersion
Here, #b and #v are aliases for the real attribute names balance and version; the : tokens refer to supplied values. This makes the intended update explicit while keeping the attribute names and values separate.
Tables showed 3/3 valid and indicated that atomic behavior was enabled. That was a local validation result: DynamoDB still had to evaluate the conditions and accept the transaction.

Figure 2. Three operations reviewed and locally validated before execution.
After execution, Tables displayed “Transaction committed successfully” and reported 6.00 capacity units. A fresh scan showed the expected data: ADV-001 now had balance 90 and version 2, ADV-NEW existed, and the other original items were unchanged.

Figure 3. Successful commit reported in Tables.

Figure 4. The item view confirms the committed changes.
A deliberate failure: what happens to the other writes?
The next request was intentionally designed to fail. I added four operations in this order:
| Position | Operation | Requested action |
|---|---|---|
| 1 | Put | Create ADV-FAIL, with balance 999 and status SHOULD_NOT_EXIST
|
| 2 | Update | Change ADV-002 to balance 999 and status SHOULD_NOT_APPEAR
|
| 3 | Delete | Delete the existing ADV-NEW item |
| 4 | ConditionCheck | Require ADV-GUARD.version = 99
|
The guard item's real version was 1, not 99. The last condition was therefore guaranteed to fail against the recorded baseline. Despite that, the builder displayed 4/4 valid because the request's structure and expressions were valid.

Figure 5. The failure test is structurally valid, even though its final condition is false.
What the failure analyzer showed
When I executed the request, Tables opened its Transaction Failure Analyzer. The result was unambiguous: one of four operations failed, and no writes were committed.
The first three operations were shown as Rolled back. The fourth was marked ConditionalCheckFailed. The analyzer also displayed the actual item value, explaining that the record had version 1 while the request expected 99.

Figure 6. Tables maps the cancellation to the fourth operation and explains the version mismatch.
This is an important distinction: DynamoDB provides the all-or-nothing transaction guarantee and the cancellation response; Tables presents those results in an operation-by-operation diagnostic view. Tables did not perform a compensating rollback after partially committed writes. The transaction was canceled without those writes committing.
The downloaded diagnostic report also contained the failing operation's cancellation details:
{
"index": 3,
"code": "ConditionalCheckFailed",
"message": "The conditional request failed"
}
The report uses a zero-based index, so index: 3 identifies the fourth operation. DynamoDB's cancellation reasons correspond to the order of actions in the submitted request, which makes this useful when investigating a longer transaction.

Figure 7. The exported diagnostic report confirms the operation index and failure reason.
I then returned to the table and ran a fresh scan. ADV-FAIL was absent, ADV-002 still had balance 50 and status ACTIVE, and ADV-NEW had not been deleted. ADV-001 and ADV-GUARD were unchanged as well.

Figure 8. The unchanged item state provides direct evidence that no partial writes committed.
Correct the condition, then verify the result
To test recovery, I changed the final condition to require the guard item's actual version, 1, and reconstructed the four-operation request.
One detail matters for interpreting the result: during this manual reconstruction, the Update action was also configured differently. Instead of attempting balance 999 and a changed status, it set ADV-002 to balance 90, version 2, leaving its ACTIVE status intact. This was a corrected and reconstructed request, not a byte-for-byte replay with only one condition changed.
The corrected transaction committed. Tables displayed a success banner reporting 8.00 capacity units, and a fresh scan reflected the submitted operations: ADV-FAIL existed, ADV-NEW was gone, and ADV-002 had balance 90 and version 2.

Figure 9. The corrected transaction commits as a single request.

Figure 10. The final Tables item state matches the reconstructed request.
I also verified the final state directly with the AWS CLI, rather than relying only on the application's table view. The command used DynamoDB's --consistent-read option:
aws dynamodb scan --table-name YOUR_TEST_TABLE --consistent-read --region us-east-1 --profile YOUR_APPROVED_PROFILE --query "Items[].{Id:id.S,Balance:balance.N,Version:version.N,Status:status.S}" --output table
The CLI returned four items:
| Item | Balance | Version | Status |
|---|---|---|---|
ADV-FAIL |
999 | 1 | SHOULD_NOT_EXIST |
ADV-001 |
90 | 2 | ACTIVE |
ADV-002 |
90 | 2 | ACTIVE |
ADV-GUARD |
0 | 1 | READY |
The deliberately named SHOULD_NOT_EXIST item should exist at this stage: its creation was part of the now-successful corrected transaction. The absent ADV-NEW item confirmed the delete operation had committed.

Figure 11. Independent AWS CLI verification matches the final state shown in Tables.
Two practical considerations: capacity and safety
Transactions provide stronger coordination, but they have capacity implications. DynamoDB performs additional work to prepare and commit transactional writes. For an item up to 1 KB, a transactional write requires two write units. Capacity can also be consumed by a canceled transaction. The 6.00 and 8.00 figures above were the capacity measurements displayed by Tables, not dollar charges; actual cost depends on usage, billing mode, and AWS pricing.
TransactWriteItems supports up to 100 actions and 4 MB of data per request. All referenced tables must be within the same AWS account and Region, and two actions cannot target the same item. These are DynamoDB constraints rather than Tables-specific limits.
The takeaway
The clearest proof of transaction atomicity came from the failed request, not the successful one. The fourth condition evaluated to false, the failure was mapped to the correct operation, and none of the preceding put, update, or delete actions committed.
Tables helped make that failure understandable through its operation-level analyzer and downloadable diagnostic report. DynamoDB supplied the underlying transactional guarantee. Checking the item state after cancellation—and verifying the corrected final result through the AWS CLI—made the difference between seeing a status message and establishing what actually happened to the data.
Top comments (0)