Skip to content

Allow concurrent DBX Web query execution#3164

Draft
lipaopao000 wants to merge 1 commit into
t8y2:mainfrom
lipaopao000:agent/web-backend-concurrent-query
Draft

Allow concurrent DBX Web query execution#3164
lipaopao000 wants to merge 1 commit into
t8y2:mainfrom
lipaopao000:agent/web-backend-concurrent-query

Conversation

@lipaopao000

Copy link
Copy Markdown

Summary

This change lets the Node Web backend execute SQL queries through /api/query/execute without first calling /api/connection/connect.

Why

When DBX_WEB_URL is set, both the CLI and MCP server use @dbx-app/node-core's Web backend. The current executeQuery() path calls /api/connection/connect before every /api/query/execute.

That pre-connect step makes concurrent CLI/MCP queries unreliable. Multiple simultaneous requests for the same connection can supersede one another during the connection attempt phase and fail with:

Connection attempt was superseded by a newer attempt

The Web query endpoint already accepts connectionId and creates or reuses a pool through the query execution path, so SQL queries do not need this UI-style connect step first.

Change

  • Removed the pre-query ensureConnected(config) call from packages/node-core/src/web-backend.ts.
  • Added a Web backend regression test that runs concurrent SQL queries and asserts that /api/connection/connect is not called.

Validation

pnpm --filter @dbx-app/node-core test
pnpm --filter @dbx-app/node-core build
pnpm --filter @dbx-app/cli test
pnpm --filter @dbx-app/mcp-server test

Observed locally:

  • node-core: 18 test files passed, 86 tests passed
  • CLI: 3 test files passed, 42 tests passed
  • MCP server: 3 test files passed, 36 tests passed

Reproduction Context

With DBX_WEB_URL pointing at DBX Web, direct /api/query/execute calls can run concurrent Oracle queries successfully, but concurrent CLI/MCP queries fail before execution because they each call /api/connection/connect first.

@lipaopao000
lipaopao000 force-pushed the agent/web-backend-concurrent-query branch from ccac569 to 8ffb5e5 Compare July 12, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant