Hello,
Say you have Two transaction, one on Isolation A.=20
Isolation x will run as Isoliation A until it finds its=20
corresponding end transation.
Now if you have a new transaction of Isolation (B) inside=20
Isolation A, it is still wrapped up in Isolation A. So it=20
will run internally as Isolation B (with all the Isolation=20
Level benefits / contraints), then at the end End=20
Transaction, puts it back into the control of Isolation A.
Apologies if seems a bit complex.
You will not need another connection, you can nest=20
transactions to your hearts content (although it gets very=20
hard for SQL Server), all will happen is that your log=20
file will keep on growing until it gets the final End=20
Transaction (or rollback) of the top level transaction.
If you wish we can run through some scenarios. My email is=20
little_flowery_me@hotmail.com.
J
[quoted text, click to view] >-----Original Message-----
>
> Thx, although this wasn't really my question. Let=20
me be more specific.
> 1. I have a top-level SP A where I set the ISOLATION=20
LEVEL x
> 2. Then from there, I want to call another SP B
> 3. In SP B, I want (!) to do a certain SELECT=20
statement under a different ISOLATOIN LEVEL than has been=20
set in SP A
[quoted text, click to view] >=20
> My questions:
> 1. What happens when SP A calls SP B and inside of B=20
a new BEGIN TRAN is defined. Will the calling of B by A=20
establish a new connection ? Then, I would guess, I can=20
set the ISOLATION LEVEL again. However, MS-SQL Help says=20
the ISOLATION LEVEL setting is set at the connection level.
[quoted text, click to view] >
> 2. If, in the above example, in SP A, I set=20
ISOLATION LEVEL SERIALIZABLE and in SP B (called from A),=20
I want to do a SELECT using ISOLATION LEVEL READ=20
UNCOMMITTED... do I lose the transactional integrity=20
that 'SERIALIZABLE' provided. Does that mean for nested=20
SPs, I would always have to apply the highest ISOLATION=20
LEVEL needed at any of the nested SPs, otherwise they=20
would be kind of 'downgraded' to READ UNCOMMITTED if I=20
were to specify that in a lower-level, nested SP (see=20
example above).
[quoted text, click to view] >
>Thanks !
>
>
>
> ----- SriSamp wrote: -----
> =20
> You do not need to do this in each SP. It is enough=20
if you do it when you
> establish the connection. This ensure that all calls=20
for the duration of the
> transaction follow the set behavior. You can=20
override it if need be in a
> particular code block.
> --=20
> HTH,
> SriSamp
> Please reply to the whole group only!
>
http://www32.brinkster.com/srisamp > =20
> "Peter" <anonymous@discussions.microsoft.com> wrote=20
in message
> news:9CA13D5B-24FE-418D-B646-
83F0B7D7DC37@microsoft.com...
> > When the client code calls a Stored Procedure=20
(SP), a new connection is
> created. The first thing I typically do inside the=20
SP is to do the:
> > BEGIN TRAN
> > SET TRANSACTION ISOLATOIN LEVEL <value>> ...<sp=20
code>> Now, if the current SP calls another SP and I also=20
do define a new
[quoted text, click to view] > transaction (BEGIN TRAN, SET TRANS...) inside that=20
called SP (@@trancount =3D
> 2), what's the effect of the SET TRANS... statement=20
inside that called SP.
> >> When reading the help file, it says "SET=20
TRANS...." ... "Controls the
> default transaction locking behavior for all=20
Microsoft=C2=AE SQL ServerT SELECT
> statements issued by a connection".
> >> My question, when a calling SP calls another SP,=20
will there be a new
> connection created or is another SET TRANS...=20
statement inside a called SP
> really meaningless ?
> >
>.