Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
3.5.1
-
Service Arch
Description
The ConnectionPool class is only used in a lambda by BackgroundSync rollback, and all the lambda does is get the underlying DBClientConnection.
The lambda is stored in RollbackSourceImpl and called to get the DBClientConnection to run some simple commands (here, here, here, and here).
It seems unnecessary to have an entire connection pool (and ConnectionPool class to manage it) just to occasionally (for rollback) get a DBClientConnection to run a few commands.
Perhaps it would be more straightforward to just give RollbackSourceImpl a unique_ptr<DBClientConnection> the way ConnectionPool::acquireConnection() internally does. This is especially true since ConnectionPool is always created with a nullptr NetworkConnectionHook anyway (the other constructor is only called by this constructor).
Possibly neweng.