Re: Another Concurrency Issue!!!!

From: Vai2000 (nospam_at_microsoft.com)
Date: 06/23/04


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
> >
> >
> >
> >
>
>



Relevant Pages

  • Re: SQL 2005
    ... The SQL Server implementation is not just Stored Procs, ... it works very tightly in proc with the SQL Server Engine(most ... Now with all that I have said T-SQL is not going away and is still a needed ... >> the CLR is now supported in stored procedures and triggers. ...
    (borland.public.delphi.non-technical)
  • Re: Performance Problem Using ADO and Stored Procs
    ... >I have a stored proc that executes in < 15 seconds through Query Analyzer. ... If I execute this proc ... > of CPU activity on the server hosting SQL server for the SQL server ... > Private Function RunProc(vntDB As Variant, strProcName As String, ...
    (microsoft.public.data.ado)
  • Re: Stored proc timeout issue
    ... The program Opens the proc and times out after 2 minutes. ... proc from sql server mgmt studio, ... I began diagnosing the problem by commenting out various lines of code in the stored proc ... One thing that remained changed was the command timeout value. ...
    (borland.public.delphi.database.ado)
  • Re: Do UDFs slow down Stored Proc execution?
    ... Tuning the queries of course would be the correct thing to do. ... works beautifully from a business logic perspective. ... I have been plowing through the Microsoft SQL Server 2000 Performance ... I don't know if you actually want to see that proc. ...
    (microsoft.public.sqlserver.programming)
  • Re: cant display data from an SQL server viewtable
    ... Against sql server, by default the client doesn't have any ... >> Private tdsdata As DataSet1 ... >> Private Sub AppsForm_Load(ByVal sender As System.Object, ... >> TIA ...
    (microsoft.public.dotnet.framework.adonet)