FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
ATOMICITY
NewsProgramming Languages

ATOMICITY

via Dev.to PythonAshiq Omar4h ago

Let me explain the transaction working using accounts table First we have an accounts table with balance for each user Alice = 1000 Bob = 500 since we are doing money transfer we need to deduct from one and add to another. Now we start transaction to transfer 200 from Alice to Bob. Lets see the commands: BEGIN ; UPDATE accounts SET balance = balance - 200 WHERE name = 'Alice' ; UPDATE accounts SET balance = balance + 200 WHERE name = 'Bob' ; COMMIT ; As we see there are no issues and the transaction is committed. Now: the values will be Alice → 800 Bob → 700 Now we try with an error in between: BEGIN ; UPDATE accounts SET balance = balance - 200 WHERE name = 'Alice' ; UPDATE accounts SET balance = balance + 2000 o WHERE name = 'Bob' ; ROLLBACK ; sql since second query has error.so transaction fails.After this failed transaction: Alice = 1000 Bob = 500 even though money was deducted first rollback will undo it so no change happens. Now we try another error case. BEGIN ; UPDATE accounts

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
0 views

Related Articles

Anthropic Literally Sued the US Defense Department for Banning It While Giving the Contract to…
News

Anthropic Literally Sued the US Defense Department for Banning It While Giving the Contract to…

Medium Programming • 20m ago

Here’s what Verge readers are buying during Amazon’s Big Spring Sale
News

Here’s what Verge readers are buying during Amazon’s Big Spring Sale

The Verge • 44m ago

Getting formal about quantum mechanics' lack of causality
News

Getting formal about quantum mechanics' lack of causality

Ars Technica • 1h ago

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day
News

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day

TechCrunch • 1h ago

I Tried Claude Code…and It Completely Changed How I Write Code
News

I Tried Claude Code…and It Completely Changed How I Write Code

Medium Programming • 1h ago

Discover More Articles