4 ms·
The title says Database Protocols, but the author writes only about MySQL and Postgres. There are other databases out there, for example Oracle that I’m the mos
by tanelpoder 2y ago
The title says Database Protocols, but the author writes only about MySQL and Postgres. There are other databases out there, for example Oracle that I’m the most familiar with and it has had a break/reset mechanism built in to its protocol for at least 30 years [1]. Its a 2 step operation (2 roundtrips), one sending an error back to the client instead of the expected result and the second step will reset “current call” (not current session or connection) state on the server side and then request the client do the same.
Databases/protocols that differentiate between connection, session and call scopes, can reliably perform resets without requiring to tear down the entire connection.
Retrying is safe with no client side transaction idempotency tokens needed, as the error handling will roll back any changes done only by the failed call, not the entire transaction or session.
[1]: https://tanelpoder.com/2008/04/10/sqlnet-breakreset-to-client/ https://tanelpoder.com/2008/04/10/sqlnet-breakreset-to-clien...
Edit: added the comment about retry and idempotency.
- bob1029 2y agoWorks in SQL Server as well. In SSMS you can press Alt + Break to send an OOB attention message to the active TDS that will cancel the running command. https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-tds/dc28579f-49b1-4a78-9c5f-63fbda002d2e https://learn.microsoft.com/en-us/openspecs/windows_protocol... I believe DB2 supports a similar technique.