3 ms·
Many databases do not actually offer this or pretend to offer this, but it is really just one thing.
by manphone 2mo ago
Many databases do not actually offer this or pretend to offer this, but it is really just one thing.
- Groxx 2mo agoFor those that don't, it's almost always modeled in the connection-library as "hold it open until commits == opens, or roll back if any roll back". Or it's often easy to build this yourself, around the library. Which works entirely fine in most cases. You're at greater risk of phantom reads and general "stuff that can occur while you hold open a transaction", but if you're not handling that correctly then you're not handling that correctly. It's only a matter of volume, not existence. ... with a clear exception for cases where you do need to truly end a transaction, like if you're relying on some other thread to do something on a different transaction that needs to see your changes, or when you risk a deadlock somewhere due to not releasing your lock. Those are both a risky patterns for a lot of reasons though, and worth avoiding at design-time if at all possible.
- unsnap_biceps 2mo agoAre you referring to save points as the "pretend to offer this"? If so, why wouldn't they work? If not, what are you referring to?
- jiggawatts 2mo agoLiterally: BEGIN TRAN BEGIN TRAN COMMIT TRAN ROLLBACK TRAN
- unsnap_biceps 2mo agoYes, but what part about that is pretend? Is there a db that doesn't do the right thing and roll back the outer transaction? If so, can you name it?