Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Nested Isolation Level

Author  Topic 

Perry
Starting Member

2 Posts

Posted - 2009-11-30 : 19:11:25
I have two stored procedure A and B.
B can be called by itself and has an isolation level of Repeatable Read.
B can also be called from A which has an isolation level of Serializable

When B is called from A's context which isolation level is honored, its own or its parent's.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-30 : 19:19:12
I would assume whichever is more restrictive.

You can verify which is in use via DBCC USEROPTIONS.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

Perry
Starting Member

2 Posts

Posted - 2009-11-30 : 20:00:36
Yes I placed the DBCC USEROPTIONS in three places:
In A Before calling B: SERIALIZABLE
In B: REPEATABLE READ
In A After calling B: SERIALIZABLE

It looks like it switches back and forth. My hope was that when calling B from A, B would respect the parent's more restrictive level.

Don't quite understand the ramifications. I mean if the records are locked by the more restrictive level in A then are released because B lowered the level, how are they relocked again with the stricter level when exiting B back to A?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-30 : 20:10:45
I don't have an answer for you, sounds like a question for Microsoft.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -