@@ -59,53 +59,53 @@ For example, consider the following sequence of user commands:
5959In the main processing loop, this results in the following function call
6060sequence:
6161
62- / StartTransactionCommand;
63- / StartTransaction;
64- 1) < ProcessUtility; << BEGIN
65- \ BeginTransactionBlock;
66- \ CommitTransactionCommand;
67-
68- / StartTransactionCommand;
69- 2) / ProcessQuery; << SELECT ...
70- \ CommitTransactionCommand;
71- \ CommandCounterIncrement;
72-
73- / StartTransactionCommand;
74- 3) / ProcessQuery; << INSERT ...
75- \ CommitTransactionCommand;
76- \ CommandCounterIncrement;
77-
78- / StartTransactionCommand;
79- / ProcessUtility; << COMMIT
80- 4) < EndTransactionBlock;
81- \ CommitTransactionCommand;
82- \ CommitTransaction;
62+ / StartTransactionCommand;
63+ / StartTransaction;
64+ 1) < ProcessUtility; << BEGIN
65+ \ BeginTransactionBlock;
66+ \ CommitTransactionCommand;
67+
68+ / StartTransactionCommand;
69+ 2) / ProcessQuery; << SELECT ...
70+ \ CommitTransactionCommand;
71+ \ CommandCounterIncrement;
72+
73+ / StartTransactionCommand;
74+ 3) / ProcessQuery; << INSERT ...
75+ \ CommitTransactionCommand;
76+ \ CommandCounterIncrement;
77+
78+ / StartTransactionCommand;
79+ / ProcessUtility; << COMMIT
80+ 4) < EndTransactionBlock;
81+ \ CommitTransactionCommand;
82+ \ CommitTransaction;
8383
8484The point of this example is to demonstrate the need for
8585StartTransactionCommand and CommitTransactionCommand to be state smart -- they
8686should call CommandCounterIncrement between the calls to BeginTransactionBlock
8787and EndTransactionBlock and outside these calls they need to do normal start,
8888commit or abort processing.
8989
90- Furthermore, suppose the "SELECT * FROM foo" caused an abort condition. In
90+ Furthermore, suppose the "SELECT * FROM foo" caused an abort condition. In
9191this case AbortCurrentTransaction is called, and the transaction is put in
9292aborted state. In this state, any user input is ignored except for
9393transaction-termination statements, or ROLLBACK TO <savepoint> commands.
9494
9595Transaction aborts can occur in two ways:
9696
97- 1) system dies from some internal cause (syntax error, etc)
98- 2) user types ROLLBACK
97+ 1) system dies from some internal cause (syntax error, etc)
98+ 2) user types ROLLBACK
9999
100100The reason we have to distinguish them is illustrated by the following two
101101situations:
102102
103- case 1 case 2
104- ------ ------
105- 1) user types BEGIN 1) user types BEGIN
106- 2) user does something 2) user does something
107- 3) user does not like what 3) system aborts for some reason
108- she sees and types ABORT (syntax error, etc)
103+ case 1 case 2
104+ ------ ------
105+ 1) user types BEGIN 1) user types BEGIN
106+ 2) user does something 2) user does something
107+ 3) user does not like what 3) system aborts for some reason
108+ she sees and types ABORT (syntax error, etc)
109109
110110In case 1, we want to abort the transaction and return to the default state.
111111In case 2, there may be more commands coming our way which are part of the
0 commit comments