OtterMind/Chat2DB · error · IllegalStateException
sqlExecution.streamingUnsupported
sqlExecution.streamingUnsupported
Error message
sqlExecution.streamingUnsupported
What it means
Thrown by DbSqlExecutionServiceImpl.executeStreaming when Chat2DBContext.getDbMetaData().getCommandExecutor() is not an instance of DefaultSQLExecutor. Streaming execution is implemented only on DefaultSQLExecutor (the instanceof pattern guard narrows to that type before calling executeStreaming); any plugin that supplies a different ICommandExecutor is rejected. Unlike the others this is an IllegalStateException (not BusinessException), resolved directly via I18nUtils.getMessage("sqlExecution.streamingUnsupported") -> 'Current datasource executor does not support streaming SQL execution'. At the web layer it is handled by DefaultExceptionConvertor, so the response body uses the generic common.systemError code even though the message text is the streaming-specific one.
Source
Thrown at chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbSqlExecutionServiceImpl.java:30
import java.sql.SQLException;
@Service
public class DbSqlExecutionServiceImpl implements IDbSqlExecutionService {
private final IDbSqlCommandService sqlSqlExecuteRequestService;
public DbSqlExecutionServiceImpl(IDbSqlCommandService sqlSqlExecuteRequestService) {
this.sqlSqlExecuteRequestService = sqlSqlExecuteRequestService;
}
@Override
public void executeStreaming(DbStreamingExecuteRequest executeStreamingRequest) throws SQLException {
SqlExecuteRequest command = sqlSqlExecuteRequestService.toSqlExecuteRequest(
executeStreamingRequest.getDlExecuteRequest());
ICommandExecutor executor = Chat2DBContext.getDbMetaData().getCommandExecutor();
if (!(executor instanceof DefaultSQLExecutor sqlExecutor)) {
throw new IllegalStateException(I18nUtils.getMessage("sqlExecution.streamingUnsupported"));
}
sqlExecutor.executeStreaming(command, executeStreamingRequest.getConsumer(),
executeStreamingRequest.getStatementListener(), executeStreamingRequest.getCancellation());
}
}
View on GitHub (pinned to 5ee1e990e7)
Solutions
- Use streaming execution only for datasources backed by DefaultSQLExecutor; fall back to normal (blocking) execution otherwise.
- If streaming is required for the type, make the plugin's command executor a DefaultSQLExecutor (or have executeStreaming delegate to it).
- Gate the streaming action in the UI on executor-type capability before sending the request.
Example fix
// before
ICommandExecutor executor = Chat2DBContext.getDbMetaData().getCommandExecutor();
if (!(executor instanceof DefaultSQLExecutor sqlExecutor)) {
throw new IllegalStateException(I18nUtils.getMessage("sqlExecution.streamingUnsupported"));
}
// after: degrade gracefully instead of hard-failing
if (!(executor instanceof DefaultSQLExecutor sqlExecutor)) {
log.warn("streaming unsupported for {}; falling back to blocking execution", executor.getClass());
sqlSqlExecuteRequestService.execute(command);
return;
} Defensive patterns
Strategy: type-guard
Validate before calling
ICommandExecutor executor = Chat2DBContext.getDbMetaData().getCommandExecutor();
if (!(executor instanceof DefaultSQLExecutor)) {
// use normal (blocking) execution; do not call executeStreaming
} Type guard
boolean streamingSupported() {
return Chat2DBContext.getDbMetaData().getCommandExecutor() instanceof DefaultSQLExecutor;
} Try / catch
try {
service.executeStreaming(req);
} catch (IllegalStateException e) { // streamingUnsupported
// fall back to blocking execution
} Prevention
- Offer streaming only for DefaultSQLExecutor-backed datasources.
- Ensure plugin executors extend DefaultSQLExecutor when streaming is desired.
When it happens
Trigger: Requesting streaming SQL execution on a datasource whose plugin's metadata returns a custom (non-DefaultSQLExecutor) command executor. The streaming consumer/statement-listener callbacks are only wired for DefaultSQLExecutor.
Common situations: A DB type with a specialized executor implementation; calling the streaming endpoint for a connection type that only supports blocking execution; a plugin that wrapped DefaultSQLExecutor instead of extending it.
Related errors
- routine.operation.onlyMysqlSupported
- account.manage.unsupported
- largeCellValue.readFailed
- count error
- dataSource.sqlAnalysisError
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/fd4a042e6025b3fb.
Report an issue: GitHub.