Skip to content

Commit b903438

Browse files
committed
test
1 parent a9432ab commit b903438

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Ydb.Sdk/src/Ado/YdbConnection.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ internal ISession Session
4141

4242
internal bool EnableImplicitSession => ConnectionStringBuilder.EnableImplicitSession;
4343

44-
internal ISession GetExecutionSession(bool useImplicit) =>
45-
useImplicit ? new ImplicitSession(Session.Driver) : Session;
44+
internal ISession GetExecutionSession(bool useImplicit)
45+
{
46+
if (!useImplicit)
47+
return Session;
48+
49+
if (_implicitSource == null)
50+
_implicitSource = new ImplicitSessionSource(Session.Driver);
51+
52+
return new ImplicitSession(Session.Driver, _implicitSource);
53+
}
54+
55+
private ImplicitSessionSource? _implicitSource;
4656

4757
internal void AdoptSession(ISession session) => _session = session;
4858

0 commit comments

Comments
 (0)