Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sp_cursorclose: The cursor identifier value provided (abcdf03) is not valid ?

11 views
Skip to first unread message

Ralf Kunde

unread,
Jan 11, 2002, 5:19:56 AM1/11/02
to
Hi,

I'm trying to select data per PreparedStatement.
(SQL is: 'SELECT pkey FROM mytable WHERE next_version = 6')

The connection is established in cursor mode, autocommit is off.
Inside the transaction I get the following error when I execute
myPreparedStatement.executeQuery():

java.sql.SQLException: [Microsoft][SQLServer JDBC
Driver][SQLServer]sp_cursorclose: The cursor identifier value provided
(abcdf03) is not valid.
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown
Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.closeCursor(Unknown
Source)
at
com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.completeRowProcessing(Unknown
Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplResultSet.close(Unknown
Source)
at com.microsoft.jdbc.base.BaseResultSet.close(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.closeCurrentResults(Unknown
Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown
Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown
Source)
...

Any ideas what's wrong ?

Thanks,

Ralf


Kamil Sykora [MS]

unread,
Jan 23, 2002, 2:53:01 PM1/23/02
to
Hello Ralf,

I used the table script and code below and I cannot reproduce the problem.
Can you provide more detail?

Create table mytable
(
pkey int CONSTRAINT pk_mtb PRIMARY KEY,
next_version int
)

INSERT INTO mytable VALUES (1,6)

Connection cn =

DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;datab
asename=database;selectMethod=cursor","user","password");

cn.setAutoCommit(false);
PreparedStatement s1 = cn.prepareStatement("SELECT pkey FROM mytable WHERE
next_version = 6");
ResultSet rs = s1.executeQuery();
cn.commit();
rs.next();
System.out.println(rs.getInt(1));
rs.close();
cn.close();


Thanks,
Kamil Sykora
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Strategic Technology Protection
Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
--------------------
| Date: Fri, 11 Jan 2002 11:19:56 +0100
| From: Ralf Kunde <Ralf....@gaussvip.com>
| Subject: sp_cursorclose: The cursor identifier value provided (abcdf03)
is not
| valid ?

Ralf Kunde

unread,
Jan 24, 2002, 5:22:27 AM1/24/02
to
Hmm,

it seems to be a little more complicated.

Outside of our application, which uses connection pooling, I cannot reproduce the
error yet.

Furthermore the select argument (6) is set by pstmt.setLong(6), so the SQLCode is
SELECT pkey FROM mytable WHERE next_version = ? .
We have two triggers connected with the table, instead of insert and instead of delete
(does this matter in these circumstances ?).

I'll try to narrow the focus on this error to provide more information.
Can you tell me when such error normally occur (e.g. explicit cursor-reuse,
PreparedStatement closed and used again etc.), so I have a hint where to search in our
application code ?

Thanks in advance

Ralf


"Kamil Sykora [MS]" schrieb:

0 new messages