Closed lavrukov closed 7 months ago
:zany_face: This is an unexpected change in YDB SDK v2, constructing a GrpcTransport
immediately establishes a GRPC connection:
public GrpcTransport build() {
YdbTransportImpl impl = new YdbTransportImpl(this);
try {
impl.init();
We might just add a Guava Suppliers.memoize()
for GrpcTransport
and SessionManager
in YdbRepository
to make initialization lazy, as it was in repository-ydb-v1
.
:arrow_right: See PR with lazy initialization here: https://github.com/ydb-platform/yoj-project/pull/61
Fixed, the fix will appear in 2.2.11.
YdbRepository in the constructor establishes a connection to the database, because it is impossible to separate the stages of object initialization and start.
It seems that what is needed here is a factory object which will create a SessionManager and return a Repository