Home All Groups Group Topic Archive Search About

1205 deadlock error when not in a transaction

Author
12 Aug 2005 11:20 AM
MrTim
We're getting a deadlock error from our application.  The error occurs on an
UPDATE, using a unique key with a clustered index.  The table is large with
over 20m rows.  The statement isn't in an explicit transaction (maybe an
implicit transaction?).  We've also had the same problem on other UPDATE
statements which are not in transactions.  Given that it's not in an explicit
transation, should this occur?  Any ideas?

SQL Server 2000 SP3.  App uses ODBC.

Author
12 Aug 2005 1:38 PM
Cowboy (Gregory A. Beamer) - MVP
If you are running multiple statements in a single BEGIN ... END block, they
are run as a batch, which is very much like a transaction in many ways. You
need to look at what is causing the deadlock, outside of your update, and see
if you can use locking hints to avoid locks on the other side of the deadlock.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


Show quote
"MrTim" wrote:

> We're getting a deadlock error from our application.  The error occurs on an
> UPDATE, using a unique key with a clustered index.  The table is large with
> over 20m rows.  The statement isn't in an explicit transaction (maybe an
> implicit transaction?).  We've also had the same problem on other UPDATE
> statements which are not in transactions.  Given that it's not in an explicit
> transation, should this occur?  Any ideas?
>
> SQL Server 2000 SP3.  App uses ODBC.
>
Author
12 Aug 2005 3:25 PM
MrTim
Not running multiple statements in a BEGIN/END block.  Have enable 1204
though, will just have to wait for it to occur again.

Still seems strange that this should occur outside of a transaction.  I've
read of a bug with OLEDB, Linked Servers and deadlocks which is fixed in SP4.
Could there possibly be a similar problem here?



Show quote
"Cowboy (Gregory A. Beamer) - MVP" wrote:

> If you are running multiple statements in a single BEGIN ... END block, they
> are run as a batch, which is very much like a transaction in many ways. You
> need to look at what is causing the deadlock, outside of your update, and see
> if you can use locking hints to avoid locks on the other side of the deadlock.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "MrTim" wrote:
>
> > We're getting a deadlock error from our application.  The error occurs on an
> > UPDATE, using a unique key with a clustered index.  The table is large with
> > over 20m rows.  The statement isn't in an explicit transaction (maybe an
> > implicit transaction?).  We've also had the same problem on other UPDATE
> > statements which are not in transactions.  Given that it's not in an explicit
> > transation, should this occur?  Any ideas?
> >
> > SQL Server 2000 SP3.  App uses ODBC.
> >

AddThis Social Bookmark Button