Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

Ledger Concurrency Bugs: Why Passing Tests Can Still Miss Lost Money

Sequential tests can miss ledger defects caused by overlapping transactions, database isolation, or incorrect retries. Learn what to test and why reconciliation provides an independent check.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A passing test suite does not prove that a ledger preserves money under concurrent writes. It proves only that the cases the suite ran passed. If those cases run one transaction at a time, use a mock instead of the production database, or check API responses without inspecting committed entries, they can miss defects triggered by real interleavings. The claim behind “Your ledger is losing money and your tests will never tell you” is too absolute: tests can expose concurrency bugs, but only when they exercise the conditions and invariants that matter.

How can a ledger pass tests and still lose money?

A ledger operation often involves several related writes: for example, postings that represent the debit and credit sides of an event. A test that checks only the response may pass even if the persisted state is wrong. A test that runs requests sequentially may also miss a defect that appears when transactions overlap.

As an Amazon Associate I earn from qualifying purchases.

Consider two requests that each read the same account balance and decide whether a debit is allowed. If both decisions are made from an outdated view of the account, the final result may violate the intended balance rule. Whether that exact outcome is possible depends on the database engine, isolation level, schema constraints, transaction boundaries, and application logic. The example illustrates why sequential tests alone are insufficient; it is not a claim about every database configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Mocks can create another blind spot: they may not reproduce the behavior of the database that handles production writes. And even a test using the real database can miss a defect if it never creates contention, forces a failure, or checks the durable postings after the operation.

#1 Best Overall
Ledger Nano X - Classic Crypto Wallet with Bluetooth | Compact, go anywhere, 1.1" display. Desktop & iOS/Android compatible
  • Effortlessly build your crypto portfolio via the all in one Ledger Wallet app: buy, sell, send, receive, swap, stake and more across popular blockchains. 15,000+ coins & tokens in a single dashboard. Keep a close eye on the market. Compare service providers. Track performance. Get timely alerts. Build your portfolio with confidence.
  • Enjoy Bluetooth connectivity, iOS access, and hours of battery use with this mobile-first, secure backup signer. Freedom you can depend on.
  • Genuine Check: confirm your signer is authentic during setup with the Ledger Wallet app.
  • Protect your signer: keep it in mint condition at all times with a bespoke Pod or Case to avoid scratches and everyday wear and tear.

What atomicity and isolation do—and do not—guarantee

Atomicity keeps one transaction from half-committing

PostgreSQL 18’s transaction documentation describes atomicity as an all-or-nothing property: concurrent transactions do not see a transaction’s intermediate state, and a failed transaction does not leave behind only some of its changes. That is essential when a business event consists of multiple writes. It does not, by itself, ensure that the application chose valid writes or that several separate transactions preserve a business invariant together.

Isolation affects how overlapping transactions interact

PostgreSQL 18 defines a serialization anomaly as a committed result that is inconsistent with every possible one-at-a-time ordering of the transactions. Its Serializable isolation level permits concurrent transactions to commit only when PostgreSQL can establish that their effect is equivalent to some serial order. These details are specific to PostgreSQL 18; check the documentation for your own database engine and configuration rather than assuming identical behavior elsewhere.

Rank #2
Ledger Flex Crypto Wallet Securely Manage All Your Digital Assets | Blue, 2.8" Gorilla Glass touchscreen signer, NFC, Bluetooth, Secure Element, Private backup
  • Simply & securely take control of your digital assets and identity with the all-in-one Ledger Wallet crypto app and Ledger Flex touchscreen signer.
  • Digital asset control at your fingertips: manage 15,000+ crypto across multiple chains. Earn rewards. Top up & share with ease. Explore DeFi with confidence. Collect and showcase NFTs. Make informed choices with clarity.
  • Connect effortlessly with Ledger Wallet: pair your secure Ledger signer with the all in one Ledger Wallet crypto app to manage thousands of digital assets across multiple devices and accounts with Ledger Sync from a single, secure dashboard.
  • Cutting-edge design: monitor the market, compare rates, and Clear Sign transactions on the secure, high resolution, 2.8'' E Ink touchscreen.
  • This is what security feels like: Ledger touchscreen signers all come with a private, offline, PIN-protected backup, Ledger Recovery Key, to never lose access to your assets.

A serialization failure must be handled as part of the design

A transaction rejected because of a serialization failure has not silently committed an unsafe result. The application still has to handle the failure correctly. PostgreSQL’s guidance is to retry the complete transaction, including the application’s decision logic—not just the last SQL statement. A final write may depend on earlier reads, so replaying it with values or decisions from an obsolete attempt can preserve the original defect. PostgreSQL does not automatically retry because it cannot guarantee that an application-level retry is correct.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to test the properties that matter

There is no universal test-count threshold that proves a ledger safe. Derive checks from the system’s business rules, run them against the persistence engine used in production, and assert the resulting durable state.

Rank #3
Ledger Nano Gen5 - Crypto Wallet - Securely Buy Digital Assets - Black | Easy-to-use, customizabe, 2.8" touchcreen signer with private backup and scam protection
  • More than just crypto: confirm your device is authentic with Genuine Check, manage all your logins with Ledger Security Key, detect common scams with Transaction Check and more.
  • Industry-defining security: battle-tested by the Donjon's white hat hackers, protected by the Secure Element, and powered by Ledger OS.
  • Connect effortlessly with Ledger Wallet: pair your secure Ledger signer with the all in one Ledger Wallet crypto app to manage thousands of digital assets across multiple devices and accounts with Ledger Sync from a single, secure dashboard.
  • Playful, user-friendly design: monitor the market, compare rates and Clear Sign all transactions on the secure 2.8'' anti-glare, scratch-resistant touchscreen.
  • This is what security feels like: Ledger touchscreen signers all come with a private, offline, PIN-protected backup, Ledger Recovery Key, to never lose access to your assets.
  1. Write down the invariant. For a double-entry event, one useful check is that its signed postings balance. For a transfer, check that total value across affected accounts is conserved, with explicit treatment for fees, exchange rates, or other permitted adjustments. These are examples, not a universal rule for every ledger design.
  2. Run conflicting operations concurrently. Exercise operations that can affect the same account or balance rule at the same time. Check committed entries and derived balances, not just response codes. Include duplicate delivery or idempotency behavior where the system needs to handle repeated requests.
  3. Exercise abort and retry paths. Cause or simulate transaction failures that the application is expected to handle. Verify that a retry reruns the full decision-making transaction and that repeated delivery does not create duplicate business effects.
  4. Verify transaction boundaries. Confirm that all writes representing one business event commit together or roll back together. A partially persisted event should fail the test even if the API returned an expected error.
  5. Recompute derived values independently. If the system stores cached or materialized balances, calculate them again from durable entries and compare the results. A matching response and cached balance are not independent checks if both depend on the same faulty update path.
  6. Inspect the persisted outcome after contention. Check the relevant entries, account totals, and any business constraints after the concurrent run finishes. A successful status code does not establish that the final state is correct.

These are practical dimensions to test, not a claim that any one published test standard prescribes this exact suite. The referenced DEV Community article describes a double-entry ledger and compares three concurrency strategies, but the available account of it does not establish the strategies’ names or detailed results. No ranking or implementation result should be inferred from that description.

Why reconciliation answers a different question

Tests ask whether the software behaves as expected under the cases they exercise. Reconciliation asks whether internal records agree with an independent record, such as a bank statement or processor report. A system can pass its own tests while its records disagree with an external witness.

Rank #4
Ledger Nano S Plus - Classic Crypto Wallet | Emerald Green, Compact, stay home 1.1" display, Desktop & Android compatible
  • All your digital assets in one place. You can manage thousands of crypto including Bitcoin, Ethereum, Solana, Tether and more.
  • Connectivity: USB-C cable connection only. No Bluetooth.Compatible with the Ledger Wallet crypto app, both desktop (Windows, macOS, Linux) and mobile (Android only). Not compatible with iOS.
  • Protect your digital assets with the industry's best security: keep your private keys offline in your private signer, battle-tested by the Donjon's white hat hackers, CC EAL 6+ certified Secure Element, constantly updated Ledger OS.
  • Effortlessly build your crypto portfolio via the all in one Ledger Wallet app: buy, sell, send, receive, swap, stake and more across popular blockchains. 15,000+ coins & tokens in a single dashboard. Keep a close eye on the market. Compare service providers. Track performance. Get timely alerts. Build your portfolio with confidence.
  • Choose the colors that match your style: express your personality and your crypto management mood, color code your signers, one for each use (trading, staking, HOLDing...).

Compare the relevant account and statement period, identify legitimate in-transit items, and investigate unmatched or aged entries. A reconciliation is only as useful as the population, period, and matching process it covers; an incomplete comparison is not proof that every transaction is accounted for. The Ledger Clinic’s article on reconciliation, updated 2026-09-11, describes investigating differences and accounting for items in transit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to investigate a suspected discrepancy

  1. Define the scope. Identify the affected accounts, period, transaction types, and expected business rules. Preserve the relevant database and application records so the review is based on the same activity.
  2. Compare records at the right level. Match individual durable postings to the related internal event and, where applicable, the external statement or processor record. Separate valid timing differences from unexplained mismatches.
  3. Rebuild balances from entries. Compare independently recomputed totals with stored or displayed balances. If they differ, identify the first event where the totals diverge rather than treating the current balance as the explanation.
  4. Reproduce the concurrency condition safely. In a test environment, run the relevant operations against the same database engine and isolation configuration, with overlapping requests and the failure paths the application uses. Assert the persisted state after completion.
  5. Review retry and duplicate handling. Confirm that failed attempts do not leave partial business events and that a complete retry does not apply the event twice.
  6. Close the control gap. Add a regression test for the discovered invariant and failure mode, then use reconciliation to identify any production records that need investigation or correction under your accounting procedures.

How to compare concurrency designs

When evaluating competing approaches, compare them on the same questions rather than treating a higher test count or a single isolation setting as proof of safety.

  • Invariant enforcement: What mechanism prevents invalid committed states under contention?
  • Database behavior: Which isolation level, locks, constraints, or other database features enforce that mechanism in the actual engine and configuration?
  • Failure handling: Which errors require a retry, and does the application retry the whole transaction with fresh decisions?
  • Idempotency and partial failure: What happens if a request is repeated or a process fails partway through an operation?
  • Contention costs: How do throughput and latency behave under representative concurrent load? A correctness control can affect performance, so measure the workload rather than assuming the trade-off.
  • Independent verification: Can durable entries be recomputed and compared with external records?

PostgreSQL 18’s documentation is clear that Serializable transactions can fail and that applications must handle those failures. That makes retry correctness part of the design, not an optional detail added after enabling an isolation level.

What a passing test suite can honestly establish

A passing suite is useful evidence about the scenarios it runs. It is not evidence about untested interleavings, unexercised retry logic, database behavior the suite does not reproduce, or agreement with external records. More unit tests or greater code coverage may improve confidence in covered behavior, but neither alone demonstrates that money is conserved in production. The useful question is whether the system’s invariants hold across concurrent commits, failures, retries, and independent reconciliation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.