- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
Transactions are hard.
Like, that's just your opinion, man.
Edit Admin
More to the point, it's always good to think about how any given sequence of database operations behaves outside of a transaction. (Is it, for example to create gibberish in the database by crashing halfway through the sequence?)
Admin
Based on the myriad of WTFs we get here it's quite obvious that developers don't being to start to formulate the possibility of having a thought as to how a database operation works. That's the job of the framework or DBA, right?
Edit Admin
Meh, transactions just sound like some pointless paranoia stuff. Surely that adds complexity at runtime and more importantly more code to write and think about. Ain't got no time for that. I mean it's a database, it's built to execute operations, so why would it fail? And if it does, we'll see them errors in the logs or some kind of exception somewhere. I mean, somebody else will see them because I have better things to do than check logs or catch exceptions or handle return error codes. That's for noobs, I write pro code that doesn't fail.
Edit Admin
Except in the first commercial system I worked on where some bright spark had the idea to use a database table for logging. It worked really well except when some error occurred that caused the transaction to abort and roll back the database, including, of course, the log table.
Admin
In a similar vein I was once asked to setup a system that would email the business if the email server went down.
I suppose you could do that nowadays with Exchange SE - but only if the SE stands for Schrödinger Edition...
Admin
Let's just say that choices were made 15 years ago and ever since I started the job in 2023 I've been handling the consequences.
Admin
I worked with a product made by a vendor who said 'if the process errors out, just roll back the database.'
That was, sadly, not the worst of their coding ills.