开发者

Some queries regarding serializable transactions?

开发者 https://www.devze.com 2023-04-13 06:58 出处:网络
I have read committed isolation can provide considerably more concurrency than serializable isolation level.

I have read committed isolation can provide considerably more concurrency than serializable isolation level.

My Question here is How Read committed isolation provides more concurrency than serializable?. A brief scenario would be a great help

Question:- Say two transactions tran1 and tran2 begin(when i say transaction begin, here it mean transaction begins when they fire some query Right?) at time t1. If tran1 updates the row1 at time t2 and later at time t3 tran2 fetches the same row it wont get the updated row done by tran1 .Right? I said it because tran1 and tran2 will the present the result from state of data which was present at time t1.Correct? Does transaction take the snapshot of complete database when it begins?

I have read that coding serializable transactions requires extra work by the application dev开发者_开发知识库eloper to check for the "Cannot serialize access" error and to undo and retry the transaction. Not sure when developer will get “Cannot serialize access” error? Will we get the same error in below scenario

Say two transactions tran1 and tran2 begin at time t1. If tran1 updates the row1 and commit at time t2 and later at time t3 tran2 updates and commits the same row1. Will it throw the “Cannot serialize access” error in this case? If yes Does oracle maintain the version internally in case of serializable transactions so that it gets to know row has been updated by user?


See Oracle docs on isolation levels and data concurrency.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号