
1. Perform a modification in auto-commit mode.
Then try to roll it back or abort it.
What happens?

2. Perform another modification within a transaction.
Then again try to roll it back or abort it.  Check the 
state of the modified data before and after the rollback.


3. Examine the behaviour of two concurrent transactions which read(T1)
and write (T2) the same row.
(For instance, start two psql sessions in two different cmd windows 
or shells). When are modifications visible in other transactions? Why?

-- T1                                  --T2
begin ;
                                       begin ;
-- T1 reads
                                       -- T2 updates
-- T1 reads
                                       -- T2 commits
-- T1 reads
-- T1 commits

4. Avoid the non-repeatable read problem.

T1                                     T2
begin;
                                       begin;
...


5. Run the same schedule as in 4) with the "Serializable" isolation level.

T1                                     T2
.....


6. Examine concurrent updates (of the same row) in two concurrent transactions.
   Use the "Read Committed" isolation level.

T1                                     T2
.....


7. Examine concurrent updates (of the same row) in two concurrent transactions.
   Use the "Serializable" isolation level.

T1                                     T2
.....


8. The normal procedure is to check whether a vehicle is free at the specified
time before a new reservation is permitted. This is in order to avoid that
reservations of the same vehicle overlap. Define a query that finds overlapping
reservations. Then define a schedule that creates two overlapping reservations.

.....

T1                                     T2
.....

9. Which options are there to avoid the above schedule? What are the trade-offs?

a.
.....

b.
.....
