Serializability of Transactions and Automatic (Number) Generators

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Thu, 25 Nov 2004 05:21:43 GMT
Message-ID: <HZdpd.3351$NU3.1913_at_newsread1.news.pas.earthlink.net>



In general, a set of transactions is considered serializable if it is equivalent to some serial execution of the same transactions (for example, see Bernstein, Hadzilacos and Goodman "Concurrency Control and Recovery in Database Systems", section 1.3 "Serializability").

Modern DBMS usually have one or more ways of automatically generating values during a transaction - Oracle (and most other DBMS) have SEQUENCE types; Informix has the SERIAL type; other DBMS have other similar constructs.

In general, the values automatically generated during a transaction are not generated again, even if the original transaction is rolled back. Further, there is nothing to stop a pair of transactions from alternately generating new values - V(n) to TxA, V(n+1) to TxB, V(n+2) to TxA, V(n+3) to TxB, and so on.

Does this mean that such transactions are inherently non-serializable, or does it mean that the specific values generated by a transaction are not material for the discussion of equivalence of executions?

If TxA were executed before TxB, it would obtain the values V(n) and V(n+1) -- rather than V(n) and V(n+2) as shown above -- but for all practical purposes, the results are equivalent: two new unique values unused by any other transaction were generated and the specific values are immaterial.

Any thoughts?

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
Received on Thu Nov 25 2004 - 06:21:43 CET

Original text of this message