updateAIS(context);
boolean localTransaction = false;
sessionMonitor.enterStage(MonitorStage.PARSE);
try {
StatementNode sqlStmt;
SQLParser parser = getParser();
try {
sqlStmt = parser.parseStatement(sql);
}
catch (SQLParserException ex) {
throw new SQLParseException(ex);
}
catch (StandardException ex) {
throw new SQLParserInternalException(ex);
}
sessionMonitor.enterStage(MonitorStage.OPTIMIZE);
if (transaction == null) {
transaction = new ServerTransaction(this, true, ServerTransaction.PeriodicallyCommit.OFF);
localTransaction = true;
}
if ((sqlStmt instanceof DMLStatementNode) &&
!(sqlStmt instanceof CallStatementNode))
return compiler.compileExecutableStatement((DMLStatementNode)sqlStmt, parser.getParameterList(), getParameterNames, autoGeneratedKeys, context);
if (autoGeneratedKeys != null)
throw new UnsupportedOperationException();
if (sqlStmt instanceof DDLStatementNode)
return new ExecutableDDLStatement((DDLStatementNode)sqlStmt, sql);
if (sqlStmt instanceof CallStatementNode)
return ExecutableCallStatement.executableStatement((CallStatementNode)sqlStmt, parser.getParameterList(), context);
throw new UnsupportedSQLException("Statement not recognized", sqlStmt);
}
finally {
sessionMonitor.leaveStage();
if (localTransaction)