Re: all about transaction
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 12/14/04
- Next message: Hugo Kornelis: "Re: Stuck due to very silly problem"
- Previous message: simon: "Distributed transaction"
- In reply to: Deepson Thomas: "Re: all about transaction"
- Next in thread: Deepson Thomas: "Re: all about transaction"
- Reply: Deepson Thomas: "Re: all about transaction"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 14 Dec 2004 10:50:08 +0100
On Tue, 14 Dec 2004 01:17:03 -0800, Deepson Thomas wrote:
>
>Thank u very much Hugo... u cleared almost all my doubts... just have some
>more .. hope u will help me... whatz this transaction isolation level ???
Hi Deepson,
The transaction isolation level is a setting that controls how long shared
locks are held by a transaction and whether exclusive locks are honored.
All available transaction isolation levels are described in detail in
Books Online.
>..... whatz chained or unchained in transactions ??? .....
I've enver heard of these and I couldn't find any reference to this in
Books Online. Where have you heard these terms?
> from where i will
>get the full details of the four isolation levels u specified in the previous
>post ....
Books Online; use the index to find "SET TRANSACTION ISOLATION LEVEL".
That's a good starting point.
>and what if i start a transaction and edited a record and at the
>same time if someother ppl start a transaction and deleted that record. when
>both of us commit the transactions whatever the data i edited will get
>removed or will get restored even after their deletion ??? ...
If you update a row, it is locked. Nobody else will can access it (except
in uncommitted read mode), so nobody will be able to delete it until your
transaction is either committed or rolled back. The person who wants to
delete the row will have to wait until the lock is lifted.
On the other hand, if the delete comes in first, you'll have to wait until
the lock is lifted before you're told that the row you want to update
doesn't exist (anymore).
>just have a
>look on the following block
>
>begin tran
> --- SQL Satetments 1 ---
> begin tran
> --- SQL Satetments 2 ---
> begin tran
> --- SQL Satetments 3 ---
> commit tran
> commit tran
>commit tran
>
>This is a nested transaction where the outer most trans is responsible for
>actual commitment according to my knowledge... can u just tell me in which
>all conditions this type of nested trans helps us ... coz till we commit this
>outer committrans the inner details also wont commit na ....
I don't think that there are any conditions where deliberately nesting
transactions would help. The only useful feature of nested transactions is
that stored procedures that use a transaction will still work as expected
when called from within an open transaction. Example:
CREATE PROC Test
AS
-- Do something
BEGIN TRAN
-- Do some more
COMMIT TRAN
go
EXEC Test --This works
go
BEGIN TRAN
-- Change some data for testing
EXEC Test -- This still works
-- Do some SELECTs to check test results
ROLLBACK TRAN -- To get rid of temporary changes for testing
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Hugo Kornelis: "Re: Stuck due to very silly problem"
- Previous message: simon: "Distributed transaction"
- In reply to: Deepson Thomas: "Re: all about transaction"
- Next in thread: Deepson Thomas: "Re: all about transaction"
- Reply: Deepson Thomas: "Re: all about transaction"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|