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

"Cursor state not valid.", AS400 JDBC, IBM JTOpen 3.0

1,810 views
Skip to first unread message

Anonymous

unread,
Apr 21, 2002, 5:40:56 PM4/21/02
to

I am using JT400.JAR from IBM's JTOpen 3.0 release.

I am running JTOpen inside of Websphere 3.5.x

JDBC auto-commit is enabled.

When running JDBC queries, I am observing intermittent SQL
exceptions.

The message that I see is "Cursor state not valid."

What is the cause of "Cursor state not valid."?

Is there a workaround?

Here is the stack trace:


java.sql.SQLException: Cursor state not valid.
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:360)
at
com.ibm.as400.access.AS400JDBCResultSet.checkOpen(AS400JDBCResultSet.java:35
6)
at
com.ibm.as400.access.AS400JDBCResultSet.beforePositioning(AS400JDBCResultSet
.java:1157)
at
com.ibm.as400.access.AS400JDBCResultSet.next(AS400JDBCResultSet.java:1680)
at foobar.AddressData_Peer.createObjects(AddressData_Peer.java:54)

Dieter Bender

unread,
Apr 22, 2002, 5:03:17 AM4/22/02
to
Hi,

it looks like a missing call to next() of the resultSet.

Dieter

Anonymous wrote:

--
Dieter Bender

www.bender-dv.de

Anonymous

unread,
Apr 22, 2002, 11:28:49 AM4/22/02
to

The exception occurs when I invoke next() on the ResultSet.

Dieter Bender

unread,
Apr 22, 2002, 3:19:28 PM4/22/02
to
Hi,

what's your code you are running?
did you have a look to the joblog of the server job? you'll will find it
easy with
wrkobjlck xxx *usrprf
where xxx is the name of the user of the connection.

Dieter

Anonymous wrote:

--
Dieter Bender

www.bender-dv.de

Anonymous

unread,
Apr 28, 2002, 7:30:10 PM4/28/02
to

I resolved the "Cursor state not valid" message.


Here is how I did it:


I discovered that my homegrown JDBC connection pool was not thread safe. It
turned out that multiple threads were simultaneously using a
java.sql.Connection object.


I cleaned up the threading issue. My app can now run SELECT statements
without a hitch.

0 new messages