Transactions
-
Level 0: Prevent other transactions from changing data that has already been modified by an uncommitted transaction.
Other transactions can read uncommitted data resulting in “dirty reads”.
-
Level 1: Prevents dirty reads. (Default on many RDBMS)
-
Level 2: prevents non-repeatable reads.
-
Level 3: Data read by one transaction is valid until the end of that transaction, preventing phantom rows.
-
Transaction unsupported: Connection.TRANSACTION_NONE
-
Level 2: Connection.TRANSACTION_SERIALIZABL
connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
-
See
Connection.TRANSACTION_READ_COMMITTED
andsetTransactionIsolation
. -
Note: Setting will become effective when starting next transaction.
No. 13
Isolation level 1 vs. 2
Q: |
What is the difference between Isolation level 1 and two? |
A: |
No. 14
JDBC™ and transactions
Q: |
|
A: |
No. 15
Aborted transactions
Q: |
In the previous exercise we mentioned the possibility of a transaction aborts being issued by a database server. Which responsibility arises for an application programmer? TipHow may an implementation become aware of an «abort transaction» event? |
A: |