java - Scenario where one should use Read committed or Serializable as Isolation level? -
i trying figure out isolation level (among serializable , read committed )is better in scenarios..at link http://download.oracle.com/docs/cd/b14117_01/server.101/b10743/consist.htm#i17894, going thru topic choice of isolation level, got clarity , questions based on statements in article.
satement :- read committed isolation can provide considerably more concurrency increased risk of inconsistent results due phantoms , non-repeatable reads transactions.
question1:- how read committed isolation provides more concurrency serializable?as per myunderstanding serializable transactions not restrict concurrent transactions.
statement:- queries in oracle serializable transaction see database of single point in time
question:- think mean here , when serializable transaction begin @ time t1 data presented state of database @ time t1.right? not sure when call transaction begins. is when connection or when first query fired?
statement:- oracle's serializable isolation suitable environments there relatively low chance 2 concurrent transactions modify same rows , long-running transactions read only
question:- 2 transactions tran1 , tran2 begin @ time t1. if tran1 updates the row1 @ time t2 , later @ time t3 tran2 fetches same row tran2 updated row done tran1 ? (i think no because tran2 fetch state of data present @ time t1.right?)
statement:- coding serializable transactions requires work application developer check "cannot serialize access" error , undo , retry transaction.
question:- not sure when developer “cannot serialize access” error. will same error in below scenario
say 2 transactions tran1 , tran2 begin @ time t1. if tran1 updates row1 @ time t2 , later @ time t3 tran2 updates same row1. throw “cannot serialize access” error in case? if yes oracle maintain version internally in case of serializable transactions gets know row has been updated user?
if want see committed data, choose read committed. each query see different committed data.
if want see same results multiple queries, choose serializable. same results returned until transaction ends.
both have limits. choose isolation level needed. not choose isolation level more need.
Comments
Post a Comment