if (cursor == null) {
LanguageConnectionContext lcc = getLanguageConnectionContext();
CursorActivation cursorActivation = lcc.lookupCursorActivation(cursorName);
if (cursorActivation != null)
{
cursor = cursorActivation.getCursorResultSet();
target = cursorActivation.getTargetResultSet();
/* beetle 3865: updateable cursor using index. 2 way communication between
* update activation and cursor activation. Cursor passes index scan to
* update and update passes heap conglom controller to cursor.
*/
activation.setForUpdateIndexScan(cursorActivation.getForUpdateIndexScan());
if (cursorActivation.getHeapConglomerateController() != null)
cursorActivation.getHeapConglomerateController().close();
cursorActivation.setHeapConglomerateController(activation.getHeapConglomerateController());
}
}
if (cursor == null || cursor.isClosed()) {
throw StandardException.newException(SQLState.LANG_CURSOR_NOT_FOUND, cursorName);