Re: Another Concurrency Issue!!!!
From: Vai2000 (nospam_at_microsoft.com)
Date: 06/23/04
- Next message: Bradley M. Small: "Re: pattern meaning"
- Previous message: Arul: "decode equivalent"
- In reply to: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Next in thread: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Reply: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Jun 2004 09:55:27 -0400
no problem with Unique key generation, only problem is concurrent requests
were allocated same key, though the new key was inserted in the Db
apparently.
TIA
"Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
news:O0f35HLWEHA.4048@TK2MSFTNGP10.phx.gbl...
> This will have the effect of choking performance, since all access will be
> serialized. Perhaps you can find another way of generating keys, such as
> allocating in blocks, using tables with identities, etc.
>
> --
> Tom
>
> ----------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com/sql
> .
> "Vai2000" <nospam@microsoft.com> wrote in message
> news:uZj8LHJWEHA.2544@TK2MSFTNGP10.phx.gbl...
> /*************************************
> create proc myproc
> (
> @paramIn int
> ,@paramOut Bigint OUTPUT
> )
> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE -- this is the modification I
> am planning
>
> SET xact_abort ON
> BEGIN TRAN
>
> select @paramOut=SELECT MAX(someID) from MyTable
> -- DML
> DELCARE @TempVar BIGINT
> SELECT @TempVar=@paramOut+10;
> insert into MyTable(....)VALUES(@tempVar)
> --
> SET xact_abort OFF
>
> COMMIT TRAN
>
> /*************************************
>
> HTH
>
> "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
> news:ONdBXpIWEHA.3596@tk2msftngp13.phx.gbl...
> > How about posting the code for your stored proc + the specs?
> >
> > --
> > Tom
> >
> > ---------------------------------------------------------------
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Columnist, SQL Server Professional
> > Toronto, ON Canada
> > www.pinnaclepublishing.com/sql
> >
> >
> > "Vai2000" <nospam@microsoft.com> wrote in message
> > news:O19YahIWEHA.1356@TK2MSFTNGP09.phx.gbl...
> > Hi All, I have a proc which returns a value after some DML operations on
a
> > table. This proc is being called by a C# program.
> > Problem is there are instances in which same value was returned back to
> the
> > C# program. How do I prevent this from happening.
> > "SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
> > Will this help in the Proc? If not what's the best way. I am avoiding
the
> C#
> > developer from putting a lock keyword in his section where he calls my
> > proc...that's my last resort.
> >
> > TIA
> >
> >
> >
> >
>
>
- Next message: Bradley M. Small: "Re: pattern meaning"
- Previous message: Arul: "decode equivalent"
- In reply to: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Next in thread: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Reply: Tom Moreau: "Re: Another Concurrency Issue!!!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|