From Newsgroup: comp.databases.theory
I was recently asked a question about 2PL and the seeker wanted clarification, based on a reference to the ever-changing cesspool known as wikipedia. So I had to arm myself with an air sickness bag and read the damn thing.
____
https://en.wikipedia.org/wiki/Two-phase_locking
God help us.
What a totally confused and self-contradictory entry. Without any reference to the real world methods actually provided and actually in use in RDBMS platforms, for over THIRTY YEARS. Ok, so the problem is that space is totally confused, and that is all that the "academics" and "theoreticians" that fill this space with pig poop know.
In order to maintain the scope of this thread and afford a fruitful discussion (whenever you are ready, Nicola), let me clarify that confusion.
1. <<Ordinary Locking>>
(not 2PL but commonly called 2PL) is required for OLTP (known by the imbeciles who are ignorant of OLTP as "low contention" or "high concurrency"), in any platform (HDBMS; NDBMS; RDBMS).
2. That means an <<Ordinary Transaction>>
in a single Server, resolving multiple concurrent Transactions. NOT a Distributed Transaction, that is distributed across multiple Servers.
3. Ordinary Transactions are <<ACID>> (since 1960).
That means the Server provides ACID, in order for the developer to code an ACID Transaction. (It is not possible to code an ACID Transaction on a non-ACID Server.)
4. A <<Distributed Transaction>>,
that is distributed across multiple Servers, requires (a) ACID in each Server, and (b) coordination between the multiple servers.
5. Because each Transaction in each Server is ACID, and Ordinary Transactions are closed with a COMMIT, the coordination protocol is called <<Two Phased Commit>>.
6. Two-Phased Commit does *NOT* require <<Two-Phased Locking>>. They are completely unrelated, but often confused because the idiots think that since the first two of three words is the same, oo oooo, the concept must be the same.
7. <<Two-Phased Locking>
not Two-Phased Commit, is required for Version-based program suites (none of them are servers by any stretch of the imagination) that provide some SQL features and fail to comply with the SQL Standard, such as Oracle and all the freeware/vapourware/nowhere suites, in order to provide some semblance of concurrency control (some fraction of [1] ). As evidenced here [corrections are mine]:
On Saturday, 14 March 2020 00:11:23 UTC+11, Nicola wrote:
MVCC has its drawbacks and some advantages, especially re concurrency
and performance, compared to 2PC [2PL]. Systems that implement MVCC sometimes
do also provide explicit lock mechanisms for the situations where
a 2PC [2PL]-like behaviour is required. The consensus seems to be that such applications are a minority and for the rest MVCC is adequate.
(I hasten not to digress, but this needs to be said. Consensus is not science, science is about facts, it does not need consensus. The consensus is false. The consensus is ignorant of the real world, where all applications require OLTP (Ordinary Locking). MVCC simply does not work. It does not work because
a. it denies the reality in the real world of databases,
b. it breaks the fundamental principle of a database, and
c. it obsesses about the non-reality in the "theoretical" world. They love their fantasies, the fantasies are very very important, given the abject ignorance of the real world.)
Therefore MVCC plus anything is also broken. 2PL is a massive add-on to the broken concept of MVCC, in a pitiful attempt to get the broken MVCC to work.
(There are no advantages to MVCC. I have asked Nicola to enumerate any claimed advantages, but there are none thus far, nothing for me to respond to.)
7. Repeating
<<Two-Phased Locking>
not Two-Phased Commit, is required for Version-based program suites that not SQL compliant , such as Oracle and all the freeware/vapourware/nowhere suites, in a feeble attempt to provide some semblance of concurrency control (some fraction of [1] Ordinary Locking).
----
The precise issue that is well-known and well understood in the high-end of the market (Sybase has 95% market share in financial institutions, but only 5% in the overall market), as implemented for THIRTY YEARS, that the sow-suckers have not touched in THIRTY YEARS, which is by evidence pathological denial of the real world (in both terms of OLTP requirements, and actual platform delivery) for THIRTY YEARS, is this.
- OLTP demands ACID (we have had that since the 1960's)
- Transactions require ACID (we have had that in DBMS since the 1970's; RDBMS since 1984)
- Versioning (MVCC) and ACID Transactions are contradictory concepts by virtue of the principles (separate to the fact that ACID Transactions are real, and MVCC is unreal -- a fantasy, that requires massive resources to erect, and thus is fundamentally opposed to OLTP -- )
--- if you have MVCC you cannot have OLTP or ACID Transactions
--- if you have OLTP or ACID Transactions, you cannot have MVCC
The evidence of over thirty years in the real world is:
- theoretically canonised pig poop such as Oracle or PissGrisNONsql which are MVCC does not have ACID. And cannot have ACID as long as they have MVCC.
- high-end SQL platforms such as Sybase and DB2/LUW have Ordinary Locking; OLTP; and ACID Transactions, with no MVCC. Genuine performance, without the erection of monstrous MVCC fantasies, that do not work, or the second set of monstrosities of 2PL that is required to shore up the first set.
As evidenced, the obsessed cretins, in pathological denial of the reality that their precious academically concocted method does not work (Stonebraker was classified as an academic), and has not worked for over THIRTY YEARS, and in pathological denial of the methods that do work in the real world, and has worked for SIXTY YEARS, throw more "ressoich" at their mountain of pig poop, in the steadfast insistence that what does not work, what has not worked for THIRTY YEARS, will work, some day. It is a massive and ongoing fraud.
Maybe in another thirty years.
Meanwhile, back at the farm, educated people, who are not crippled by the pig poop that the "academics" and "theoreticians" who allege they serve this space shameless market as "theory", provide OLTP; ACID Transactions; using Ordinary Locking, with no problem whatsoever. For over thirty years.
Cheers
Derek
--- Synchronet 3.21d-Linux NewsLink 1.2