By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,610 Members | 2,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,610 IT Pros & Developers. It's quick & easy.

Cursors defined as "WITH HOLD" are closed after commit.

P: n/a
Hello.

W2K, DB2 ESE V8.2.1

I created a dummy sql sp that returns 2 result sets.
One of cursors inside it I declared as "with hold with return"
and another as "with return" (without "with hold").
When I call this sp from java application (started under JRE 1.4) that
uses jcc driver (suppose c - Connection object, cs - CallableStatement
object) with c.setAutoCommit(true) and cs declared as
cs = conn.prepareCall
(
"...",
ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY,
ResultSet.HOLD_CURSORS_OVER_COMMIT
);

I get such results:

1. When I don't use c.commit() after cs.execute() I get these result
sets.
2. When I use c.commit() after cs.execute() I don't get any result
sets.

Question: Is it feature or bug?

When I do the same at OS400 (V5R2) using
"com.ibm.as400.access.AS400JDBCDriver" driver I still get these result
set even after c.commit(). It is strange too because I expect to get
only one (with option "WITH HOLD") result set...

Sincerely,
Mark B.

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.