Re: Transaction deadlock

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Ivan (ice348_at_net-yan.com)
Date: 05/14/04


Date: Fri, 14 May 2004 09:41:49 +0800

Hi Mary,

Thanks for your reply...
actually, what do u mean the nolock hint... I don't quite understand...

btw... i found a solution for my situation...
which is, if i don't execute 2 same (exactly the same) SELECT statement..
the deadlock won't happen... however, i still wonder how to fix it...
coz i 'm sure i'll face the similar situation again later....

Ivan

"Mary Chipman" <mchip@online.microsoft.com> ???
news:uis6a0tk3elefge78l980586n8eka6p59f@4ax.com ???...
> One thing you might try is to execute the SELECT with the nolock hint.
> That should give you the uncommitted dirty read of the rows, if that
> is what you are looking for.
>
> --Mary
>
> On Thu, 13 May 2004 17:15:16 +0800, "Ivan" <ice348@net-yan.com> wrote:
>
> >Hi All,
> >
> >Does anyone know how to prevent dead lock when
> >selecting records within Transaction??
> >
> >Let me describe abit clear.
> >I created & open a transaction and before i commit/ rollback the
transaction
> >i have to select few records within the same table
> >but the problem is once i execute a select sql statement for serveral
times
> >(usually more than 2 times)... the select sql will be hold and the whole
> >application will be hung...
> >I guess the reason is because the transaction haven't finished
> >and as a result the select sql should be on queue
> >
> >I have tried various solutions like changing the transaction level ...
but
> >none of them work as needed
> >
> >so.. please tell me if anyone know the solutions... thanks to all
> >
> >Ivan
> >
>



Relevant Pages

  • Re: locking hints and isolation levels ?
    ... the first session an open transaction without closing it (ie., ... "rollback tran" and close your transaction. ... NOLOCK is only used for emergency fixes on SELECT statements only but i ... "committed" equivenltent just not sure what hint to use. ...
    (microsoft.public.sqlserver.server)
  • Advice on locking/performance issue
    ... Query Hinting using the WITH (NOLOCK) option should ease ... are they server or application ... >>Each 'object' insertion is wrapped in a transaction. ... >>The locking issue is just horrible. ...
    (microsoft.public.sqlserver.programming)
  • Re: Question on Locks
    ... The mode and Type of the the lock are important here. ... > Even the default Transaction Isolation Level is Read Committed which means> I should be able to read those records that are already committed, ... >> Use NOLOCK and READPAST sparingly. ... >> If you run the same with the NOLOCK hint, you'll get results instantly ->> but you'll see Clinton being born in 2002, in violation of the business>> rule! ...
    (microsoft.public.sqlserver.programming)
  • Re: NOLOCK hint
    ... INNER JOIN table2 b WITH (NOLOCK) ... So even though you have no explicit BEGIN TRANSACTION, the isolation level still applies. ...
    (microsoft.public.sqlserver.programming)
  • Re: Access and equiv of Transact-SQLs Nolock hint?
    ... > uncommitted transaction might be rolled back. ... > Why don't you just test your queries in the SQL Query Analyzer & see ... I have had to use NOLOCK on a few occasions where I ... was using a data table as the source of a ComboBox RowSource. ...
    (microsoft.public.access.queries)