Friday, March 13, 2009

What are different types of isolation levels in JDBC and explain where you

Question :What are different types of isolation levels in JDBC and explain where you
can use them? (JDBC)

Answer :If the application needs only committed records, then
TRANSACTION_READ_COMMITED isolation is the good choice.
If the application needs to read a row exclusively till you finish your work,
then TRANSACTION_REPEATABLE_READ is the best choice.
If the application needs to control all of the transaction problems(dirty
read, phantom read and unrepeatable read), you can choose
TRANSACTION_SERIALIZABLE for maximum safety. Performance issues
have to be taken care with this. E.g Banking applications.
If the application don't have to deal with concurrent transactions, then the
best choice is TRANSACTION_NONE to improve performance.
If the application is searching for records from the database then you can
easily choose TRANSACTION_READ_UNCOMMITED because you need not
worry about other programmes that are inserting records at the same
time. It improves performance.

No comments: