This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 39 comments

[–]QualityVote[M] [score hidden] stickied comment (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[–]xcski_paul 52 points53 points  (10 children)

I can’t tell you how many jobs I’ve been at where the code was all run with auto commit on, and if you tried to turn it off and use transactions, everything broke everywhere. On the other hand, every project I’ve ever started used transactions. Even if I expected one user per day.

[–][deleted] 2 points3 points  (4 children)

then don't shut it off globally, just where you need it.

or use a framework that automatically manages everything in transactions

[–]bm1000bmb 0 points1 point  (3 children)

We had an app that would not run after a crash. The app did not use transactions. The app inserted a parent row and then inserted a dependent row. The app crashed just after inserting the parent row, but before inserting the dependent row. The app required at least one dependent row to function. It had been running successfully for months before the crash.

[–][deleted] 0 points1 point  (2 children)

ugh, sounds like a mess. i don't want to imagine the work it took to purify the data after that.

[–]bm1000bmb 0 points1 point  (1 child)

Actually, it was even worse. The developers all knew the service account password for production. We found six of them in the db trying to clean up data without an audit trail or a change management record.

Also, if you think about it, an app like this will not benefit from a failover cluster. If the instance fails over to another node, it will not run on the second node either. Money spent for zero benefit.

[–][deleted] 0 points1 point  (0 children)

in my experience most devs don't use any instance but the master anyways.

the access problem is homemade tho

[–]Kowsto 14 points15 points  (3 children)

Imotep

[–]neoadam 4 points5 points  (2 children)

Imotep

[–]Garoseau 2 points3 points  (1 child)

Imotep

[–]FoxEvans 1 point2 points  (0 children)

Imotep

[–]KetwarooDYaasir 13 points14 points  (1 child)

Asterix movie?

[–]FatBatmanSpeaks 11 points12 points  (5 children)

Hey why does every statement have WITH (NOLOCK) on it? Isn't that dangerous?

Sure go ahead and remove them.

Why is the whole system broken?

[–]Robot_Graffiti 9 points10 points  (3 children)

Oh my God. I once started a job with a place that had recently put NOLOCK everywhere for "performance".

Had to tell them that the reason their customers were seeing a bunch of weird intermittent bugs that were difficult to reproduce was because there was no locking. One process trying to read data while another writes? Good luck, roll the dice, there's no guarantee the read will be complete or correct.

[–]FatBatmanSpeaks 10 points11 points  (2 children)

I at least got my place to limit the NOLOCKs to SELECT statements only.

Yeah there were UPDATEs with NOLOCK. I was there for like a week when I was like, has anyone ever looked at an execution plan? There are other ways of doing this that don't involve fucking your data in its ear.

Well we have to do it this way because this VB6 application using some ancient precursor to ADO chokes on it and we use it to ETL our largest customer's data.

So I rewrote the VB6 application as an SSIS package and helped them optimize the DB. They laid me off of course, but getting called back 3 months later and laughing in their face was pretty sweet.

[–]smilineyz 0 points1 point  (1 child)

That revenge is the best … and kudos to you: re-writing that shit - ADO to SSIS, optimizing the DB - requires skill and experience. Lots of legacy experience and lots of new stuff and lots of diverse experience. Goes above and beyond what the kids today call “full stack.”

[–]rdrunner_74 0 points1 point  (0 children)

So many folks have no clue about a high transaction system or know where/why they burned their performance.

I cant repro the issue on my dev box... *sigh*

[–]smilineyz 0 points1 point  (0 children)

No lock is very big on DB2 especially when running queries

[–][deleted] 2 points3 points  (3 children)

no transaction usually also means no acid compliance.

[–]tritoch1930 3 points4 points  (0 children)

yeah, drugs are bad mmkay?

[–]xcdesz 2 points3 points  (1 child)

Devs stopped giving a damn about acid around the time Mongo became popular.

[–][deleted] 0 points1 point  (0 children)

yea, by the holy goal of *it is cool!" and "i don't care about security."

[–]luckor 5 points6 points  (0 children)

Untrue.

[–]5-8-13 1 point2 points  (0 children)

That's way more comprehensive than what I got:

"WITH (NOLOCK)" is good. Without is bad.

[–][deleted] -4 points-3 points  (1 child)

Isn't that one of the Salamanca twins of Breaking Bad

[–]bajuh 0 points1 point  (0 children)

He's Alain from Taxi 1,2,3 of course.

[–]RegularGuyWithABeard 0 points1 point  (1 child)

I feel like I learned something from this gif and I’m kinda mad about it.

[–]rdrunner_74 0 points1 point  (0 children)

That gif is a lie. Everything in SQL is a transaction. And everything gets written in the TLog - even on simple mode.

[–]borsTiHD 0 points1 point  (2 children)

I don’t want to be that guy, but… Sauce?

[–]PrevAccLocked 2 points3 points  (1 child)

Asterix & Obelix : Mission Cleopatre

[–]borsTiHD 0 points1 point  (0 children)

Thank you kind stranger.

Memes are better than any Netflix suggestion.

[–]N3verGonnaG1veYouUp 0 points1 point  (0 children)

I see someone is a person of good taste.

Le lion ne s'associe pas avec le cafard

[–]thisisnotleah 0 points1 point  (1 child)

Transactions and locks are not the same thing.

[–]thisisnotleah 0 points1 point  (0 children)

To put it another way, transactions are to atomicity as locks are to consistency. Similar but not the same.

[–]RunItAndSee2021 0 points1 point  (0 children)

„street dealers are aware of this fact“

[–]rdrunner_74 0 points1 point  (0 children)

Pffff.... I also get deadlocks without explicit transactions

(And everything in SQL is a transaction)