** recompiled. Get a new Activation and check whether the
** parameters are compatible. If so, transfer the parameters
** from the old Activation to the new one, and make that the
** current Activation. If not, throw an exception.
*/
BaseActivation newAC = (BaseActivation) newGC.newInstance(lcc);
DataTypeDescriptor[] newParamTypes = ps.getParameterTypes();
/*
** Link the new activation to the prepared statement.
*/
newAC.setupActivation(ps, ac.getScrollable());
newAC.setParameters(ac.getParameterValueSet(), paramTypes);
/*
** IMPORTANT
**
** Copy any essential state from the old activation
** to the new activation. This must match the state
** setup in EmbedStatement.
** singleExecution, cursorName, holdability, maxRows.
*/
if (ac.isSingleExecution())
newAC.setSingleExecution();
newAC.setCursorName(ac.getCursorName());
newAC.setResultSetHoldability(ac.getResultSetHoldability());
if (ac.getAutoGeneratedKeysResultsetMode()) //Need to do copy only if auto generated mode is on
newAC.setAutoGeneratedKeysResultsetInfo(ac.getAutoGeneratedKeysColumnIndexes(),
ac.getAutoGeneratedKeysColumnNames());
newAC.setMaxRows(ac.getMaxRows());
// break the link with the prepared statement
ac.setupActivation(null, false);
ac.close();