Transaction isolation level for SELECT

Given a transaction running in a relational database, the launch of the SELECTS series.

I assume that if in the middle of this transaction any other transaction commits some UPDATE or INSERT against the database, this new data is VISIBLE for the remaining remaining samples in the previous transaction. Is this assumption correct?

I mean, I assume that the transaction is not isolated for reading ( it always reads the last state of the database, even if it changes at the same time ), but only for emails, is this?

If it depends on the transactional policies of each RDBMS, what is the Oracle policy?

+4
source share
2 answers

Copy and paste the answer provided as a comment on the question:

The default isolation level in Oracle is β€œread” (you β€œsee” changes made by other transactions, even if they were made after the transaction started). Oracle also allows you to set the isolation level to "serializable" (you only see "changes" that were made by other transactions at the time the transaction started) or "read-only" (for example, "serializable", except that it does not allow INSERT , UPDATE or DELETE). For all details see link .

0
source

Your assumption is true, at least for Oracle.

Oracle ensures consistency in the reading that is currently in progress. After the start of reading, it does not matter if other transactions have changed the selected data. Oracle ensures that the data is in the database at the beginning of reading. If he cannot fulfill this guarantee, you will receive the error message "ORA-01555 is too old." However, subsequent samples may not receive the same answer.

To ensure reads of isolation / repeatable readings, you must discard some concurrency because you need to block the table from updates. Oracle decided to be very parallel - readers do not block.

If you are just looking for data at a given time, Oracle is performing flashback requests.

+4
source

Source: https://habr.com/ru/post/1386538/


All Articles