What are transaction isolation levels in EJB?

What are transaction isolation levels in EJB?

1. Transaction_read_uncommitted
2. Transaction_read_committed
3. Transaction_repeatable_read
4. Transaction_serializable

Explain the types of isolation levels that J2EE supports.

Isolation Levels describes the degree to which the data being updated is visible to other transactions. There are 4 types of isolation levels supported by J2EE described as follows:

TRANSACTION_READ_UNCOMMITTED:
A static final variable / constant specifies the non-repeatable reads, dirty reads and phantom reads occurrences. This allows a specific row that is changed by one of the transactions to be read by another specific transaction well before the changes in that row have been committed. In case of any roll backs, an invalid row will be retrieved by the second transaction.

TRANSACTION_READ_COMMITTED:
A static final variable / constant that specifies the prevention of the dirty reads, non-repeatable reads and phantom reads occurrences.

TRANSACTION_REPEATABLE_READ:
A static final variable / constant that specifies the prevention of dirty reads and non-repeatable reads and the occurrences of phantom reads.

The level indicates the prohibitions of reading a row with uncommitted changes in it, and also indicates the prohibition in specific situations where one transaction reads a row, a second transaction alters the row and the first transaction rereads the row.

TRANSACTION_SERIALIZABLE:
A static final variable / constant that indicates the prevention of dirty reads, non-repeatable reads and phantom reads. This includes the prohibitions in TRANSACTION_REPEATABLE_READ.

It further prohibits the following situations:
- First transaction reads all rows that satisfy a WHERE condition
- A second transaction that inserts rows that satisfies the WHERE condition and
- First transaction rereads for the same condition, retrieving the additional phantom row in the second read.
What is Entity Bean?
What is Entity Bean? - The entity bean is used to represent data in the database. Entity beans provide a component model that allows.....
What is preinitialization of a servlet?
What is preinitialization of a servlet? - The process of loading a servlet before any request comes in is called preloading or preinitializing a servlet.....
What is the difference between JSP and Servlets?
What is the difference between JSP and Servlets? - JSP supports only HTTP protocol. But a servlet can support any protocol like HTTP, FTP, SMTP etc....
Post your comment