дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
fix(database): isolate JDBC console sessions (#6553)
Two SQL consoles on one JDBC data source waited on the same connection, so a long query, cancellation or close in one blocked the other. The JDBC bridge now multiplexes one connection per console inside the existing bridge JVM (capped at 32, with bounded reply buffers), and result reads, cancel and close are routed to the originating console's connection. DuckDB console connections share the database and its attachments with separate temporary tables and session settings; anonymous SQLite and H2 databases keep one shared connection so their contents stay visible. Fixes #6484 Co-authored-by: principalwater <[email protected]>
Цей коміт міститься в:
1 джерело
8fd5ee382d
коміт
4b3717618f
17 files changed
+1637
-354
No files matched your search
@@ -40,6 +40,10 @@ When switching to JDBC, configure TLS and driver-specific settings in the JDBC U
|
||||
|
||||
Select the profile, enter the vendor's JDBC URL, and use the **User**, **Password**, and **Advanced** fields for credentials and driver properties. The URL and Advanced properties are stored in the data source configuration. Put credentials in the password field to use the existing OS credential store. On Linux, saving a password requires a running Secret Service. You can also enter the password for the current session. The **Read-only** option asks the JDBC driver for a read-only connection. Use a database account with read-only privileges to enforce it. Cancelling a query keeps the session and its temporary tables when the driver stops the statement. If the driver does not respond within three seconds, OpenIDEA closes the session. A submitted statement can still finish on the server. **Test Connection** reports the database product and version. Schema, table and column browsing use JDBC metadata; the SQL console supports auto-commit queries and updates. Vendor-specific DDL, execution plans and table-grid writes are unavailable for custom drivers.
|
||||
|
||||
Each SQL console uses its own JDBC connection. Use the same console for statements that need its temporary tables or session settings. Other consoles can run queries while it is busy. OpenIDEA keeps the connection until you close the console and its result tabs.
|
||||
|
||||
DuckDB consoles share the same database, including an in-memory database. Anonymous SQLite and H2 databases belong to one connection, so their consoles share that connection. For independent consoles on the same in-memory database, use a named URL such as `jdbc:sqlite:file:work?mode=memory&cache=shared` or `jdbc:h2:mem:work`.
|
||||
|
||||
For a file-backed database, use an absolute path to choose its location. Relative paths start in the persistent `jdbc/files` folder inside OpenIDEA’s application data directory.
|
||||
|
||||
Profiles are reused across projects. If a project file changes a connection's URL or properties outside the IDE, review the settings in the data source dialog and save them before reconnecting.
|
||||
|
||||
@@ -40,6 +40,10 @@ description: "连接 SQL 数据库、浏览架构、在查询控制台中执行
|
||||
|
||||
选择驱动配置,填写厂商的 JDBC URL,在 **用户**、**密码** 和 **高级** 中设置凭据和驱动属性。通过密码字段输入的密码可以保存到系统凭据库。在 Linux 上,保存密码需要正在运行的 Secret Service;也可以仅为当前会话输入密码。**测试连接** 显示数据库产品和版本。可以通过 JDBC 元数据浏览模式、表和列,在 SQL 控制台中查询或以自动提交方式更新数据。自定义驱动不支持厂商特有的 DDL、执行计划或表格编辑。
|
||||
|
||||
每个 SQL 控制台使用独立的 JDBC 连接。依赖临时表或会话设置的语句应在同一控制台中执行,其他控制台可以同时运行查询。关闭控制台及其结果标签页后,OpenIDEA 会释放连接。
|
||||
|
||||
DuckDB 的各个控制台共享同一个数据库,包括内存数据库。SQLite 和 H2 的匿名数据库仅属于一个连接,因此其控制台会共用该连接。如需让多个控制台通过独立连接访问同一个内存数据库,可使用命名 URL,例如 `jdbc:sqlite:file:work?mode=memory&cache=shared` 或 `jdbc:h2:mem:work`。
|
||||
|
||||
文件数据库可使用绝对路径指定存储位置。相对路径以 OpenIDEA 应用数据目录下的持久化 `jdbc/files` 文件夹为起点。
|
||||
|
||||
驱动配置可以跨项目复用。在 IDE 外更改项目数据源的 URL 或连接属性后,需要在数据源对话框中检查并保存设置,才能重新连接。
|
||||
|
||||
Reference in new issue
Заблокувати користувача