sp_getapplock returns -999

sp_getapplock returns -999

Post by Patrick Harm » Tue, 16 Apr 2002 08:20:28



Hi everyone

I have a problem, don't we all  It's in regards to the sp_getappllock stored
procedure. Every once in a while it fails with a -999 return code value.
According to the Microsoft documentation, that's a "Parameter validation or
other call error". Retrying the call later works.

It takes four arguments:
- the application resource that is being locked. A string value up to 255
characters.
- the lock mode, can be one of these values: Shared, Update, Exclusive,
IntentExclusive, IntentShared.
- the lock owner, Transaction (the default), or Session.
- a timeout value in milliseconds.

In my code, the last three arguments, are literals, so as the code works
most of the time, they are unlikely to be the cause of the problem.

The first parameter is a concatenation of two numbers separated by a colon.
For example, a resource that it failed was 767:1

A further piece of information is that the code is written in Java and uses
Microsoft's JDBC Beta 2 drivers.

Does anyone have any clues on what is happening here ?

Regards
Patrick

begin 666 wink.gif
M1TE&.#EA#P`/`+,``````+^_O___````````````````````````````````


`
end

 
 
 

sp_getapplock returns -999

Post by Rashmi Dave[M » Wed, 17 Apr 2002 07:48:57


Easiest way to find out if the problem is even in SQL Server is to use
Profiler trace , turn it on with one of the templates provided and capture
while the error occurs.  Errors will be logged as Exceptions or OLE-DB
errors ( don't forget to include that event) .  Preferably do this on a
test server so that you don't see that many connections and your profiler
looks uncluttered.

Sometimes the code executed does not even reach SQL Server but is rejected
at the JDBC driver level itself.  If that is so you will not see anything
coming to SQL from the connection.  

This posting is provided AS IS with no warranties, and confers no rights.
You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
reserved.
--------------------

| Subject: sp_getapplock returns -999
| Date: Mon, 15 Apr 2002 09:20:28 +1000
| Lines: 38
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

| Newsgroups: microsoft.public.sqlserver.programming
| NNTP-Posting-Host: 203.63.43.242
| Path: cpmsftngxa07!tkmsftngp01!tkmsftngp07
| Xref: cpmsftngxa07 microsoft.public.sqlserver.programming:250092
| X-Tomcat-NG: microsoft.public.sqlserver.programming
|
| Hi everyone
|
| I have a problem, don't we all  It's in regards to the sp_getappllock
stored
| procedure. Every once in a while it fails with a -999 return code value.
| According to the Microsoft documentation, that's a "Parameter validation
or
| other call error". Retrying the call later works.
|
| It takes four arguments:
| - the application resource that is being locked. A string value up to 255
| characters.
| - the lock mode, can be one of these values: Shared, Update, Exclusive,
| IntentExclusive, IntentShared.
| - the lock owner, Transaction (the default), or Session.
| - a timeout value in milliseconds.
|
| In my code, the last three arguments, are literals, so as the code works
| most of the time, they are unlikely to be the cause of the problem.
|
| The first parameter is a concatenation of two numbers separated by a
colon.
| For example, a resource that it failed was 767:1
|
| A further piece of information is that the code is written in Java and
uses
| Microsoft's JDBC Beta 2 drivers.
|
| Does anyone have any clues on what is happening here ?
|
| Regards
| Patrick
|
|
|
|

 
 
 

sp_getapplock returns -999

Post by Patrick Harm » Thu, 18 Apr 2002 07:43:56


Rashmi

Thanks for that info.

I've delegated the problem to another programmer in my organisation who may
use that approach depending on what another lead shows.

I didn't realise that you could look at the source for the stored procedure
:-)  Looking at the source for the sp_getapplock, shows when a -999 status
is returned. There are three places, but only one is really possible for my
code (as I'm using literals which would either work all the time or fail or

I suspect that I have a thread synchronisation problem, as I have explicit

transaction.

Regards
Patrick


> Easiest way to find out if the problem is even in SQL Server is to use
> Profiler trace , turn it on with one of the templates provided and capture
> while the error occurs.  Errors will be logged as Exceptions or OLE-DB
> errors ( don't forget to include that event) .  Preferably do this on a
> test server so that you don't see that many connections and your profiler
> looks uncluttered.

> Sometimes the code executed does not even reach SQL Server but is rejected
> at the JDBC driver level itself.  If that is so you will not see anything
> coming to SQL from the connection.

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. ? 2001 Microsoft Corporation. All rights
> reserved.
> --------------------

> | Subject: sp_getapplock returns -999
> | Date: Mon, 15 Apr 2002 09:20:28 +1000
> | Lines: 38
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

> | Newsgroups: microsoft.public.sqlserver.programming
> | NNTP-Posting-Host: 203.63.43.242
> | Path: cpmsftngxa07!tkmsftngp01!tkmsftngp07
> | Xref: cpmsftngxa07 microsoft.public.sqlserver.programming:250092
> | X-Tomcat-NG: microsoft.public.sqlserver.programming
> |
> | Hi everyone
> |
> | I have a problem, don't we all  It's in regards to the sp_getappllock
> stored
> | procedure. Every once in a while it fails with a -999 return code value.
> | According to the Microsoft documentation, that's a "Parameter validation
> or
> | other call error". Retrying the call later works.
> |
> | It takes four arguments:
> | - the application resource that is being locked. A string value up to
255
> | characters.
> | - the lock mode, can be one of these values: Shared, Update, Exclusive,
> | IntentExclusive, IntentShared.
> | - the lock owner, Transaction (the default), or Session.
> | - a timeout value in milliseconds.
> |
> | In my code, the last three arguments, are literals, so as the code works
> | most of the time, they are unlikely to be the cause of the problem.
> |
> | The first parameter is a concatenation of two numbers separated by a
> colon.
> | For example, a resource that it failed was 767:1
> |
> | A further piece of information is that the code is written in Java and
> uses
> | Microsoft's JDBC Beta 2 drivers.
> |
> | Does anyone have any clues on what is happening here ?
> |
> | Regards
> | Patrick
> |
> |
> |
> |

 
 
 

1. Error 999 - Bad return code

I'm getting the following error message today for one user:

DB Error 999: Bad return code
Unable to connect to database.

The SQL client is running TCP/IP, and can see the rest of the
network. Does anyone have any suggestions how to correct this?

Thanks in advance.

John

2. JDBC - URL string settings?

3. Text box - picture number format '999,999,999.99'

4. Table Keeps reappearing after dropping

5. Error 999 ??

6. Print screen in I4gl (fgl_prtscr)

7. Error 999: SqlDumpExceptionHandler. EXCEPTION_ACCESS_VIOLATION

8. Problem with closing tables Paradox 8

9. Problem Connecting; error 999

10. Error 999 ??

11. Can't make 999 milliseconds with DATEADD

12. Storing and Displaying 999-99-9999 as text

13. Oracle8 ODBC trouble for text more than 999 chars