Take a look at the example in section 14.2.4.4 Using this example, if the cursor CURSOR1 represented by the ResultSet rs is not held, i.e. if it is mode CLOSE_CURSORS_AT_COMMIT (section 14.1.3) then it is clear the example's positioned updates can only succeed if auto commit is false. Because, if auto commit is true, then execution of stmt2 (the update statement) will close the ResultSet, as described in section 10.1 (the paragraphs before 10.1.1).
Extract from 10.1
For Select statements, the statement is complete when the associated result set is closed. The result set is closed as soon as one of the following occurs:
- all of the rows have been retrieved
- the associated Statement object is re-executed
-another Statement object is executed on the same connection
The first clarification needed is:
1) If cursor CURSOR1 had holdability HOLD_CURSORS_OVER_COMMIT and if the connection has auto commit set to true, would CURSOR1 still be closed by the execution of stmt2?[ This is an Issue because 10.1 does not mention holdability while section
14.1.3 talks about closing a cursor on a explicit or implicit commit ]
The second clarification depends on the first one:
2) If the answer to the first question is that a cursor with holdability
HOLD_CURSORS_OVER_COMMIT is not closed, then the question becomes can the
positioned update actually succeed if the connection is in auto commit mode?
###@###.### 2004-02-02
Extract from 10.1
For Select statements, the statement is complete when the associated result set is closed. The result set is closed as soon as one of the following occurs:
- all of the rows have been retrieved
- the associated Statement object is re-executed
-another Statement object is executed on the same connection
The first clarification needed is:
1) If cursor CURSOR1 had holdability HOLD_CURSORS_OVER_COMMIT and if the connection has auto commit set to true, would CURSOR1 still be closed by the execution of stmt2?[ This is an Issue because 10.1 does not mention holdability while section
14.1.3 talks about closing a cursor on a explicit or implicit commit ]
The second clarification depends on the first one:
2) If the answer to the first question is that a cursor with holdability
HOLD_CURSORS_OVER_COMMIT is not closed, then the question becomes can the
positioned update actually succeed if the connection is in auto commit mode?
###@###.### 2004-02-02