镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Cancel statement don’t work due to “Session is locked by a concurrent client” (0.3.2-patch11) #1033

Closed

Description

@Veirisa

Hi!

I'm unable to cancel a statement using the cancel() method if session_id is set.

I had the same problem with the driver v0.3.1, however, there it was possible to set the SESSION_ID to null for the ru.yandex.clickhouse.ClickHouseStatementImpl statement before cancelling with ru.yandex.clickhouse.ConfigurableApi#addDbParam.

With a new driver, a similar approach with the com.clickhouse.jdbc.internal.ClickHouseStatementImpl statement does not help.
I tried to remove session_id from CUSTOM_PARAMS using com.clickhouse.client.ClickHouseRequest#option, however, this is not enough.

I need your help.
Tell me, please, how can I reset the session_id in the driver v0.3.2? Or is there another way to make cancel() work?

Activity

  1. zhicwu commented on Aug 6, 2022

    @zhicwu
    Contributor

    Sorry it's a bug introduced in 0.3.2-patch10. The session_id defined in connection string is re-used for query cancellation, which does not work(because ClickHouse can only execute one query at a time for each session). I don't have a good workaround for this, but you must use patch11, you may consider remove session_id from connection string and manage session manually using unwrapped statement(e.g. statement.unwrap(ClickHouseRequest.class).session(...).query(...).execute()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions