File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/Ydb.Sdk/src/Ado/Session Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33
44namespace Ydb . Sdk . Ado . Session ;
55
6- internal class ImplicitSession : ISession
6+ internal sealed class ImplicitSession : ISession
77{
88 private readonly ImplicitSessionSource ? _owner ;
9+ private int _disposed ;
910
1011 public ImplicitSession ( IDriver driver )
1112 {
@@ -33,10 +34,10 @@ public ValueTask<IServerStream<ExecuteQueryResponsePart>> ExecuteQuery(
3334
3435 var request = new ExecuteQueryRequest
3536 {
36- ExecMode = ExecMode . Execute ,
37+ ExecMode = ExecMode . Execute ,
3738 QueryContent = new QueryContent { Text = query , Syntax = Syntax . YqlV1 } ,
38- StatsMode = StatsMode . None ,
39- TxControl = txControl
39+ StatsMode = StatsMode . None ,
40+ TxControl = txControl
4041 } ;
4142 request . Parameters . Add ( parameters ) ;
4243
@@ -53,7 +54,8 @@ public void OnNotSuccessStatusCode(StatusCode code) { }
5354
5455 public void Dispose ( )
5556 {
56- _owner ? . ReleaseLease ( ) ;
57+ if ( Interlocked . Exchange ( ref _disposed , 1 ) == 0 )
58+ _owner ? . ReleaseLease ( ) ;
5759 }
5860
5961 private static YdbException NotSupportedTransaction =>
You can’t perform that action at this time.
0 commit comments