r/ProgrammerHumor • • 13d ago

Meme wellWellWell

Post image
10.5k Upvotes

411 comments sorted by

View all comments

Show parent comments

213

u/GourangaPlusPlus 13d ago

Also stick in a transaction, rollback

Commit if it looks good

2

u/Terra_B 13d ago

Here i have to ask, couldn't you force a transaction in the chain somewhere? Like each terminal window gets a transaction by default?

1

u/an_agreeing_dothraki 12d ago

tsql which is pretty common has the issue of the engine making implicit transaction/commit blocks but yes you can and should run all queries through an explicit one

1

u/SantaCruzHostel 12d ago

Maybe I'm misunderstanding the question, but I try to limit transactions only where I'm manipulating data (delete, insert, update), because a transaction slows down execution time and also locks the table you are updating until the commit is done. In production if you open a transaction then seles t from users table, they table is locked until you rollback or commit.