Issue Details (XML | Word | Printable)

Key: DERBY-66
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Mamta A. Satoor
Reporter: Mamta A. Satoor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Derby does not support open cursor across commits for XA transactions and hence DatabaseMetaData.supportsOpenCursorsAcrossCommit should return false.

Created: 11/Nov/04 07:42 AM   Updated: 10/Feb/05 07:59 AM
Return to search
Component/s: JDBC
Affects Version/s: 10.0.2.0
Fix Version/s: 10.1.1.0

Time Tracking:
Not Specified

Resolution Date: 10/Feb/05 07:59 AM


 Description  « Hide
Derby returns false for DatabaseMetaData.supportsOpenCursorsAcrossCommit. But that seems incorrect because Derby does support open cursor across commits and hence DatabaseMetaData.supportsOpenCursorsAcrossCommit return true.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jon Craven added a comment - 12/Nov/04 10:34 AM
What's the difference between open cursors across commits and holding cursors across commit? Derby clearly supports the latter, supportsResultSetHoldability() returns true and HOLD_CURSORS_OVER_COMMIT is the default holdability.

Shreyas Kaushik added a comment - 19/Nov/04 09:40 AM
Currently the supportsOpenCursorsAcrossCommits returns false, the fix for this is to make it return true? Can more explanation be provided for the previous comment?

Mamta A. Satoor added a comment - 02/Dec/04 06:29 AM
IMO, open cursors across commits and holding cursors across commits mean one and the same thing for Derby. But what is unclear to me is the description of return value of DatabaseMetaData.supportsOpenCursorsAcrossCommit in the JDBC api.

The JDBC api says following
boolean supportsOpenCursorsAcrossCommit() throws SQLExceptionRetrieves whether this database supports keeping cursors open across commits.
Returns:
true if cursors always remain open; false if they might not remain open
Throws:
SQLException - if a database access error occurs

A ResultSet object maintains a cursor pointing to its current row of data. Derby will keep the cursor open across commit if the ResultSet object's holdability is set to HOLD_CURSORS_OVER_COMMIT. If the ResultSet object's holdability is set to CLOSE_CURSORS_AT_COMMIT, the cursor will be closed when the transaction is committed. So, in Derby, whether a cursor stays open or closed across commit depends on the holdability of the ResultSet object. Does it then mean from the above api description that supportsOpenCursorsAcrossCommit() should return false in Derby?
If that is the conclusion, then there is no bug with current implementation of supportsOpenCursorsAcrossCommit().

Shreyas Kaushik added a comment - 23/Dec/04 10:14 AM
I think it's the other way around. As the JDBC api says "Retrieves whether this database supports keeping cursors open across commits" it is the property of the database.

Since Derby can have cursors that are open across commits it should return true.

To be even precise, when creating a ResultSet handle that needs to have cursors open across commits, a check on whether the underlying Database supports such a holdability has to be checked.

Mamta A. Satoor added a comment - 19/Jan/05 10:06 AM
The fix for this went as svn commit: r125571

Mamta A. Satoor added a comment - 31/Jan/05 03:33 PM
I think the patch for this bug is incorrect because Derby doesn't support open cursors across commits for XA transactions. This might have been the reason why DatabaseMetaData.supportsOpenCursorsAcrossCommit was returning false prior to the submitted patch. I will submit a new patch which will have DatabaseMetaData.supportsOpenCursorsAcrossCommit return false.

Mamta A. Satoor added a comment - 10/Feb/05 07:59 AM
The patch for this was committed as revision 152678