ydb-platform / ydb-java-sdk

YDB Java SDK
https://ydb.tech
Apache License 2.0
36 stars 19 forks source link

Add control of session state #238

Open alex268 opened 6 months ago

alex268 commented 6 months ago

Current implementation of sessions and the session pool doesn't include the control of the session state. And we often have next problems:

  1. Usage of session after closing
  2. Parallel usage of one session
  3. Deleting session by client error or canceling

We can resolve these problem by adding the control of current session state - idle, active, executing, canceled and etc. And every action on the session can check this state and returns an error if client uses session in wrong way