frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

A stray commit buried multiple levels deep cost me months

https://www.droppedasbaby.com/posts/db-commits/
25•offbyone42•1h ago

Comments

Retr0id•58m ago
> DO NOT blame the framework

Why not? Why should I be allowed to db.commit() midway through a transaction?

Stitch4223•48m ago
With great power comes great responsibility.
Retr0id•46m ago
Well, I don't want either. Give me a safe API!
UqWBcuFx6NV4r•45m ago
This is like people saying that C is infallible and it’s those stupid lesser-developers that unlike me simply cannot wield its immense power. No. Usability matters. After all these years software development still has an ‘unfounded male confidence / posturing’ problem and it’s just cringeworthy
hackthemack•37m ago
I agree. No matter how complicated, or unnecessary, or unintuitive a piece of software or technology is... There is always this contingent of people who pop in and say "It is not that hard!" and furthermore tend to express a view of "I am superior because I figured out this obtuse thing, and you must be inferior because you have not figured it out".

I do not know why that mentality exists in the industry, but I see it all the time... for the past 35 years.

saghm•37m ago
Yes, and the people who designed that API clearly were not worthy of of the responsibility of providing it
offbyone42•44m ago
Giving "I cut my finger with a knife, why is the knife so sharp?" energy. JKJK.

I think the option should be there, but it needs to be used responsibly.

Retr0id•40m ago
What's the use case? I've never found myself wishing my transaction wasn't actually atomic.
p-e-w•19m ago
The option to make a transaction not be a transaction? What is it then?
jiggawatts•35m ago
Database engines I've worked with generally support nested transactions, so you can open a transaction, open another transaction, commit it, then roll back the outer transaction... and it's like nothing ever happened.

This ability to compose transactions is their main benefit over other kinds of concurrency control!

manphone•15m ago
Many databases do not actually offer this or pretend to offer this, but it is really just one thing.
Groxx•3m ago
[delayed]
quamserena•40m ago
This is trivially preventable via affine types
eqvinox•38m ago
> # calls helpers that eventually call commit()

Show, don't tell. The article should've included an example of these helpers.

All in all, this feels poorly written, but also poorly thought out. The DB layer can and should throw an exception if you manually begin/commit inside a context manager. Please do blame it if it doesn't.

hparadiz•34m ago
Feel like I've solved this non problem like 20 times.

If your framework is holding your records in a collection and you keep track of phantoms that have been edited but not saved as they are edited then all this becomes a non issue. That way you do Collection->SaveTransaction or Collection->Save() and the collection does all the db commit, roll back nonsense.

Anyway the examples I don't even know if I could call that an ORM. Use a better one.

khaledh•31m ago
If someone can trivially introduce bad state (or worse, data loss), then the API is clearly broken.
magicalhippo•28m ago
I found the article very hard to follow. Then I read the domain name and it all made sense...

Guess our pattern is different, not really felt the pain point the author is talking about. Or it's the language/framework, not sure whatever the example code is written in, but setting properties on entity records would never update the database in the ones I've used.

When we did things more manually we'd make sure that methods like `create_main_records` would start a transaction if not in one, and only commit if it started the transaction. This way we could nest without worry. Our database supported nested transactions but using this pattern we didn't feel the need.

nine_k•6m ago
Tired: pass live DB model objects around, mutate them to accumulate random changes, call commit() five levels deep, experience the chaos as described by the author.

Wired: fetch DB records and construct domain objects, pass them around, do mutation on the outermost level within an explicit transaction. (Typical best practice.)

Inspired: "functional core, imperative shell".

AI financial advice is surprisingly good if you ask the right questions

https://mitsloan.mit.edu/ideas-made-to-matter/ai-financial-advice-surprisingly-good-especially-if...
102•foxtrot8672•2h ago•67 comments

Seedance 2.5

https://seed.bytedance.com/en/blog/one-take-creation-flexible-referencing-introducing-seedance-2-5
120•njaremko•3h ago•46 comments

Diátaxis

https://diataxis.fr/
154•ryanseys•4h ago•23 comments

Unraveling the mysteries of habit formation

https://www.kyoto-u.ac.jp/en/research-news/2026-07-28
19•hhs•1h ago•7 comments

Postmortem for Kernel Soundness Bug #14576

https://leodemoura.github.io/blog/2026-8-1-postmortem-for-kernel-soundness-bug-14576/
105•juhopitk•6h ago•39 comments

But can your calculator run Linux?

https://raymii.org/s/articles/But_can_your_calculator_run_Linux.html
56•jandeboevrie•4h ago•4 comments

The Art of 64-bit Assembly

https://nostarch.com/art-64-bit-assembly-v2
178•0x54MUR41•10h ago•85 comments

CISA Alert: Water Sector PLC Targeting

https://censys.com/blog/cisa-alert-water-tower-plc-targeting/
58•speckx•5h ago•43 comments

Morph (YC S23) Is Hiring Member of Technical Staff

https://www.ycombinator.com/companies/morph/jobs/0Z8vI3K-member-of-technical-staff
1•bhaktatejas922•1h ago

RFC 10015: Deprecating Obsolete Key Exchange Methods in TLS 1.2 and DTLS 1.2

https://www.rfc-editor.org/rfc/rfc10015.html
4•Jimmc414•52m ago•0 comments

How Google helped destroy adoption of RSS feeds (2023)

https://openrss.org/blog/how-google-helped-destroy-adoption-of-rss-feeds
364•pudgywalsh•6h ago•130 comments

Nyctography: A substituton cypher by Lewis Carroll

https://en.wikipedia.org/wiki/Nyctography
47•nanna•4d ago•3 comments

RipGrep musl binaries occasionally segfault during very-large searches

https://github.com/BurntSushi/ripgrep/issues/3494
245•throwaway2037•12h ago•166 comments

NetBSD 11.0

https://blog.netbsd.org/tnf/entry/netbsd_11_0_released
203•jaypatelani•6h ago•85 comments

Just because a game is on disc doesn't mean it will work in the future

https://arstechnica.com/gaming/2026/07/the-disc-is-not-the-game-physical-releases-increasingly-re...
91•rbanffy•1d ago•76 comments

Explorative modeling: Train on the best of K guesses

https://alexiglad.github.io/blog/2026/explorative_modeling/
75•DSemba•9h ago•21 comments

A stray commit buried multiple levels deep cost me months

https://www.droppedasbaby.com/posts/db-commits/
25•offbyone42•1h ago•17 comments

Show HN: Legionlinuxtui – Control Lenovo legion laptops in the terminal

https://github.com/nooneknowspeter/legionlinuxtui
6•nooneknowspeter•2d ago•0 comments

Kenji/Serious Eats – 30-Min Pressure Cooker Pho Ga

https://www.seriouseats.com/30-minute-pressure-cooker-pho-ga-recipe
83•stasomatic•8h ago•53 comments

Pgtestdb's template cloning approach to testing is fast

https://brandur.org/fragments/pgtestdb
61•brandur•8h ago•36 comments

Glyphs 4 – the leading Mac font editor

https://glyphsapp.com
45•microflash•4d ago•8 comments

Designing Icons

https://m3.material.io/styles/icons/designing-icons
5•Cider9986•1d ago•0 comments

Anime User Interfaces

https://animeuserinterface.tumblr.com
44•akyuu•1h ago•8 comments

Linux on ESP32

https://github.com/GrieferPig/esp32-s31-linux
95•boveyking•4d ago•33 comments

RamenHaus

https://ramen.haus/
223•oler•15h ago•106 comments

Kaisel – Routes as Values. Dart 3 Native Router for Flutter

https://kaisel.dev/
51•TheWiggles•7h ago•8 comments

A Surveillance Treaty in Disguise: Canada Signs UN Cybercrime Convention

https://www.michaelgeist.ca/2026/07/a-surveillance-treaty-in-disguise-the-trouble-with-canadas-qu...
264•iamnothere•10h ago•144 comments

Flint: A Visualization Language for the AI Era

https://microsoft.github.io/flint-chart/
251•vinhnx•21h ago•66 comments

The Burau representation of the braid group is faithful for n = 4

https://arxiv.org/abs/2607.05283
44•wglb•5d ago•18 comments

Cursor removed cost information from the usage page and CSV export

https://forum.cursor.com/t/usage-page-to-token-amount-what/167153
297•EugeneOZ•9h ago•131 comments