473,480 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SQL 2000 Error: 1203, Severity: 20, State: 1 Error

Our SQL Server 200 box is getting perflib errors when we get a decent
amount of people using an application that I wrote, call queue system,
web based. To accomplish a queue type system on a button push I wrote
a query like this...

BEGIN TRANSACTION;
Select top 1...fields here...
FROM table with (xlock,readpast)
(2 joins)
WHERE numerous where clauses
ORDER BY 2 order bys.

Now our sql server starts timing out..then in the app log this shows
up....

Error: 1203, Severity: 20, State: 1

Process ID 62 attempting to unlock unowned resource PAG: 6:1:126407.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

The reason I am doing xlock is to make a record not viewable to 2
people if they click the button on the web form that runs the above
query within the same minute, they would get different records....

So to avoid this error which I assume is due to my xlock should I
rethink my query?

Jul 13 '06 #1
3 4893
wreed (wh****@gmail.com) writes:
Our SQL Server 200 box is getting perflib errors when we get a decent
amount of people using an application that I wrote, call queue system,
web based. To accomplish a queue type system on a button push I wrote
a query like this...

BEGIN TRANSACTION;
Select top 1...fields here...
FROM table with (xlock,readpast)
(2 joins)
WHERE numerous where clauses
ORDER BY 2 order bys.

Now our sql server starts timing out..then in the app log this shows
up....
SQL Server times out? If you get a message "Timeout expired" that is a
client-side timeout. Or have you enabled lock timeouts.
Error: 1203, Severity: 20, State: 1

Process ID 62 attempting to unlock unowned resource PAG: 6:1:126407.
...
So to avoid this error which I assume is due to my xlock should I
rethink my query?
1203 is definitely to regard as an internal server error, so you are
hitting a bug of some sort.

It would be interesting to know what happens first, the timeout or the
1203. And what sort of timeout you get.

Since by default most client libraries has a default timeout of 30
seconds, I assume that you have a client-side timeout. When you get
such a timeout, you should always issue a IF @@trancount 0 ROLLBACK
TRANSACTION, because there is no automatic rollback on timeouts.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 13 '06 #2

Erland Sommarskog wrote:
>
SQL Server times out? If you get a message "Timeout expired" that is a
client-side timeout. Or have you enabled lock timeouts.
Error: 1203, Severity: 20, State: 1

Process ID 62 attempting to unlock unowned resource PAG: 6:1:126407.
...
So to avoid this error which I assume is due to my xlock should I
rethink my query?

1203 is definitely to regard as an internal server error, so you are
hitting a bug of some sort.

It would be interesting to know what happens first, the timeout or the
1203. And what sort of timeout you get.

Since by default most client libraries has a default timeout of 30
seconds, I assume that you have a client-side timeout. When you get
such a timeout, you should always issue a IF @@trancount 0 ROLLBACK
TRANSACTION, because there is no automatic rollback on timeouts.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Can it be that I am running a TOP 1 and the query is actually pulling a
whole query back then only taking the top row? Or am I totally wrong
on how a TOP 1 works.

Jul 17 '06 #3
wreed (wh****@gmail.com) writes:
Erland Sommarskog wrote:
>>
SQL Server times out? If you get a message "Timeout expired" that is a
client-side timeout. Or have you enabled lock timeouts.
Error: 1203, Severity: 20, State: 1

Process ID 62 attempting to unlock unowned resource PAG: 6:1:126407.
...
So to avoid this error which I assume is due to my xlock should I
rethink my query?

1203 is definitely to regard as an internal server error, so you are
hitting a bug of some sort.

It would be interesting to know what happens first, the timeout or the
1203. And what sort of timeout you get.

Since by default most client libraries has a default timeout of 30
seconds, I assume that you have a client-side timeout. When you get
such a timeout, you should always issue a IF @@trancount 0 ROLLBACK
TRANSACTION, because there is no automatic rollback on timeouts.

Can it be that I am running a TOP 1 and the query is actually pulling a
whole query back then only taking the top row? Or am I totally wrong
on how a TOP 1 works.
Exactly how a TOP 1 is implemented is up to the optimizer. And what
ORDER BY clause you specified.

Yes, TOP 1, could be part of the reason you get this error, although
the locking hints are even more suspects in this case. But as I said,
this is an internal server error. It should simply not occur, and when
it does, it's not your fault.

....unless you first get the query timeout, and you then fail to rollback
the transaction, and the error happens because this creates a mess.

So when this scenario, do you first get a timeout (which happens in the
client), or do you first get the 1203 error?
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jul 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
15202
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
4
14963
by: Jason | last post by:
My understanding is that in a stored procedure (or any code for that matter) if an error occurs you can detect it by checking @@error variable and raise your own error with raiserror statement. ...
3
1734
by: Michael Teja via SQLMonster.com | last post by:
I made a trigger for delete just like this. " CREATE TRIGGER ON . FOR DELETE AS Declare @severity int, @IdNmbr nvarchar(10) Set @Severity = 0
4
1876
by: interflex | last post by:
We have a three tier application running on two tiers. 1&2 running on one server and a seperate server for the databases. On the database server we are running Windows 2000 Server with 3Gb of RAM...
9
7350
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
2
2187
by: Ananta | last post by:
Hi I am having a problem with the SQL server connected in VC#.net I am using the SQLDataAdaptors to access and fill the data to the DataSets. There are certain pages in sequence which run...
0
2165
by: Maciek | last post by:
Hi, I have this question regarding SQL Server error 3621: "The statement has been terminated." and trapping it in Try...Catch block. I've written sample Stored Procedure which intentionally...
11
1737
by: Andrew Poelstra | last post by:
I hammered this out this morning to fix inconsistancies with the way my programs handle errors. The code itself is fine, in that it compiles with Richard Heathfield's gcc tags (plus -c because it...
12
2503
by: mast2as | last post by:
Hi everyone... I have a TExceptionHandler class that is uses in the code to thow exceptions. Whenever an exception is thrown the TExceptionHander constructor takes an error code (int) as an...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7048
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
6956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5342
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
183
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.