11using System . Collections . Concurrent ;
22using Ydb . Sdk . Ado . Session ;
3+ using Ydb . Sdk . Pool ;
4+ using Ydb . Sdk . Services . Query ;
35
46namespace Ydb . Sdk . Ado ;
57
68internal static class PoolManager
79{
810 private static readonly SemaphoreSlim SemaphoreSlim = new ( 1 ) ; // async mutex
9- private static readonly ConcurrentDictionary < string , ISessionSource > Pools = new ( ) ;
11+ private static readonly ConcurrentDictionary < string , SessionPool > Pools = new ( ) ;
1012
1113 internal static async Task < ISession > GetSession (
1214 YdbConnectionStringBuilder settings ,
@@ -15,7 +17,7 @@ CancellationToken cancellationToken
1517 {
1618 if ( Pools . TryGetValue ( settings . ConnectionString , out var sessionPool ) )
1719 {
18- return await sessionPool . OpenSession ( cancellationToken ) ;
20+ return await sessionPool . GetSession ( cancellationToken ) ;
1921 }
2022
2123 try
@@ -24,16 +26,16 @@ CancellationToken cancellationToken
2426
2527 if ( Pools . TryGetValue ( settings . ConnectionString , out var pool ) )
2628 {
27- return await pool . OpenSession ( cancellationToken ) ;
29+ return await pool . GetSession ( cancellationToken ) ;
2830 }
2931
30- var newSessionPool = new PoolingSessionSource < PoolingSession > (
31- await PoolingSessionFactory . Create ( settings ) , settings
32+ var newSessionPool = new SessionPool (
33+ await settings . BuildDriver ( ) , new SessionPoolConfig ( )
3234 ) ;
3335
3436 Pools [ settings . ConnectionString ] = newSessionPool ;
3537
36- return await newSessionPool . OpenSession ( cancellationToken ) ;
38+ return await newSessionPool . GetSession ( cancellationToken ) ;
3739 }
3840 finally
3941 {
0 commit comments