Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

S1109: Invalid cursor position; no keyset defined

5 posts in General Discussion Last posting was on 2005-11-15 18:37:39.0Z
Tom Daffin Posted on 2005-11-08 21:03:39.0Z
From: "Tom Daffin" <tdaffin@geographix.com>
Newsgroups: ianywhere.public.general
Subject: S1109: Invalid cursor position; no keyset defined
Lines: 20
Organization: GeoGraphix
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-Original-NNTP-Posting-Host: 192.246.76.91
Message-ID: <43711f5e$1@forums-2-dub>
X-Original-Trace: 8 Nov 2005 13:57:50 -0700, 192.246.76.91
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 8 Nov 2005 13:57:51 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 8 Nov 2005 14:03:39 -0700
X-Trace: forums-1-dub 1131487419 10.22.108.75 (8 Nov 2005 14:03:39 -0700)
X-Original-Trace: 8 Nov 2005 14:03:39 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4926
Article PK: 31487

I'm working in MFC using a CRecordset derived class. I update the values in
any combination of 3 fields, including nulling them out.

After about 20 updates, I get this error in the ::SQLSetPos that the MFC
code is doing:

Invalid cursor position; no keyset defined
State:S1109,Native:0,Origin:[Sybase][ODBC Driver]

That appears to result in the database connection being dropped, and the app
locks up in a loop of errors.

I've searched the web for this one, and the closest I have come is a
description of an error on SQL server that mentions this can happen when a
key field gets updated as the row has to be deleted and re-inserted, but the
cursor is still on it. In this case, none of the key fields are changing.

Has anyone seen this before? Any suggestions as to what I can do?


Nick Elson Posted on 2005-11-09 15:31:27.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
Newsgroups: ianywhere.public.general
References: <43711f5e$1@forums-2-dub>
Subject: Re: S1109: Invalid cursor position; no keyset defined
Lines: 31
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Original-NNTP-Posting-Host: nicelson-xp.sybase.com
Message-ID: <437222ff@forums-2-dub>
X-Original-Trace: 9 Nov 2005 08:25:35 -0700, nicelson-xp.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 9 Nov 2005 08:25:36 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 9 Nov 2005 08:31:27 -0700
X-Trace: forums-1-dub 1131553887 10.22.108.75 (9 Nov 2005 08:31:27 -0700)
X-Original-Trace: 9 Nov 2005 08:31:27 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4932
Article PK: 8604

Check out the server's log. If need be add a -z -zr all -o ___.txt to
see the error happening.

The reason for the disconnect should be identified in there someplace.

"Tom Daffin" <tdaffin@geographix.com> wrote in message
news:43711f5e$1@forums-2-dub...
> I'm working in MFC using a CRecordset derived class. I update the values
> in any combination of 3 fields, including nulling them out.
>
> After about 20 updates, I get this error in the ::SQLSetPos that the MFC
> code is doing:
>
> Invalid cursor position; no keyset defined
> State:S1109,Native:0,Origin:[Sybase][ODBC Driver]
>
> That appears to result in the database connection being dropped, and the
> app locks up in a loop of errors.
>
> I've searched the web for this one, and the closest I have come is a
> description of an error on SQL server that mentions this can happen when a
> key field gets updated as the row has to be deleted and re-inserted, but
> the cursor is still on it. In this case, none of the key fields are
> changing.
>
> Has anyone seen this before? Any suggestions as to what I can do?
>
>


Tom Daffin Posted on 2005-11-14 23:18:31.0Z
From: "Tom Daffin" <tdaffin@geographix.com>
Newsgroups: ianywhere.public.general
References: <43711f5e$1@forums-2-dub> <437222ff@forums-2-dub>
Subject: Re: S1109: Invalid cursor position; no keyset defined
Lines: 50
Organization: GeoGraphix
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: 192.246.76.91
Message-ID: <437919c8$1@forums-2-dub>
X-Original-Trace: 14 Nov 2005 15:12:08 -0800, 192.246.76.91
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 14 Nov 2005 15:12:09 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 14 Nov 2005 15:18:31 -0800
X-Trace: forums-1-dub 1132010311 10.22.108.75 (14 Nov 2005 15:18:31 -0800)
X-Original-Trace: 14 Nov 2005 15:18:31 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4950
Article PK: 8612

Thanks for the tip. I've done as you suggested, and gotten a detailed log
of what is going on.
Basically, I'm getting this warning in the db:
I. 11/14 15:35:42. ** REQUEST conn: 29655992 CURSOR_FETCH
Crsr=1638562, Count=1, Offset=0 (relative)
I. 11/14 15:35:42. ** WARNING conn: 29655992 code: 104 "Row has been
updated since last time read"
I. 11/14 15:35:42. ** DONE conn: 29655992 CURSOR_FETCH
The strange thing is, I get this warning 3 times, and there is no problem,
but then, it dies -- I get the error in the app and the conenction is
lost...
Sometimes, it takes longer to go wrong, sometimes it goes right away.

Any suggestions?

"Nick Elson" <no_spam_nicelson@sybase.com> wrote in message
news:437222ff@forums-2-dub...
> Check out the server's log. If need be add a -z -zr all -o ___.txt to
> see the error happening.
>
> The reason for the disconnect should be identified in there someplace.
>
>
> "Tom Daffin" <tdaffin@geographix.com> wrote in message
> news:43711f5e$1@forums-2-dub...
>> I'm working in MFC using a CRecordset derived class. I update the values
>> in any combination of 3 fields, including nulling them out.
>>
>> After about 20 updates, I get this error in the ::SQLSetPos that the MFC
>> code is doing:
>>
>> Invalid cursor position; no keyset defined
>> State:S1109,Native:0,Origin:[Sybase][ODBC Driver]
>>
>> That appears to result in the database connection being dropped, and the
>> app locks up in a loop of errors.
>>
>> I've searched the web for this one, and the closest I have come is a
>> description of an error on SQL server that mentions this can happen when
>> a key field gets updated as the row has to be deleted and re-inserted,
>> but the cursor is still on it. In this case, none of the key fields are
>> changing.
>>
>> Has anyone seen this before? Any suggestions as to what I can do?
>>
>>
>
>


Tom Daffin Posted on 2005-11-15 17:13:13.0Z
From: "Tom Daffin" <tdaffin@geographix.com>
Newsgroups: ianywhere.public.general
References: <43711f5e$1@forums-2-dub> <437222ff@forums-2-dub> <437919c8$1@forums-2-dub>
Subject: Re: S1109: Invalid cursor position; no keyset defined
Lines: 9
Organization: GeoGraphix
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 192.246.76.91
X-Original-NNTP-Posting-Host: 192.246.76.91
Message-ID: <437a1729@forums-1-dub>
Date: 15 Nov 2005 09:13:13 -0800
X-Trace: forums-1-dub 1132074793 192.246.76.91 (15 Nov 2005 09:13:13 -0800)
X-Original-Trace: 15 Nov 2005 09:13:13 -0800, 192.246.76.91
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4952
Article PK: 31498

Well, it appears that the error I reported there is benign...
When the real error occurs, there is nothing at all in the server error
log -- it just reports that a 'CURSOR_PREFETCH' finished ok, and the next
thing up, it reports a disconnection.

I've also done an ODBC trace, and in there I get the same error reported as
I do in the application. Perhaps this could be a driver problem?


Tom Daffin Posted on 2005-11-15 18:37:39.0Z
From: "Tom Daffin" <tdaffin@geographix.com>
Newsgroups: ianywhere.public.general
References: <43711f5e$1@forums-2-dub> <437222ff@forums-2-dub> <437919c8$1@forums-2-dub> <437a1729@forums-1-dub>
Subject: Re: S1109: Invalid cursor position; no keyset defined
Lines: 25
Organization: GeoGraphix
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 192.246.76.91
X-Original-NNTP-Posting-Host: 192.246.76.91
Message-ID: <437a2af3$2@forums-1-dub>
Date: 15 Nov 2005 10:37:39 -0800
X-Trace: forums-1-dub 1132079859 192.246.76.91 (15 Nov 2005 10:37:39 -0800)
X-Original-Trace: 15 Nov 2005 10:37:39 -0800, 192.246.76.91
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4953
Article PK: 8614

Ok, I got this problem fixed.

I still don't know what caused it, but, seeing as the recordset I was
updating in the application only had one row, I decided to Requery it every
time I update it. In the server log, this causes a close of the old cursor,
and opens a new one.

Everything works fine now!

So, thanks for the tip about the server log, it was very educational!

"Tom Daffin" <tdaffin@geographix.com> wrote in message
news:437a1729@forums-1-dub...
> Well, it appears that the error I reported there is benign...
> When the real error occurs, there is nothing at all in the server error
> log -- it just reports that a 'CURSOR_PREFETCH' finished ok, and the next
> thing up, it reports a disconnection.
>
> I've also done an ODBC trace, and in there I get the same error reported
> as I do in the application. Perhaps this could be a driver problem?
>
>