You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment each of the 8 classes inheriting from IdentityTable create their own open connection to the DB at instantiation, all of which will only be closed when the scoped instance is disposed. This seems inefficient. I am a long way from an expert on the topic, but I wonder whether a more efficient method of doing this could be created by using any/all of:
Have the scoped IDbConnectionFactory return a single instance rather than create a new connection every time. Have the IDbConnectionFactory - now really an IdbConnectionStore implement IDisposable instead of the IdentityTables, and rather than create have a getOrCreate property.
Only access the connection in the IdentityTable instances when required, rather than at instantiation
Do not open the connection manually - as I understand if the connection is not open Dapper will open and close it automatically when one of the execute or query methods is called. It may however be more efficient to leave the connection open - I am unsure.
The text was updated successfully, but these errors were encountered:
At the moment each of the 8 classes inheriting from
IdentityTable
create their own open connection to the DB at instantiation, all of which will only be closed when the scoped instance is disposed. This seems inefficient. I am a long way from an expert on the topic, but I wonder whether a more efficient method of doing this could be created by using any/all of:IDbConnectionFactory
- now really anIdbConnectionStore
implement IDisposable instead of theIdentityTables
, and rather than create have agetOrCreate
property.IdentityTable
instances when required, rather than at instantiationexecute
orquery
methods is called. It may however be more efficient to leave the connection open - I am unsure.The text was updated successfully, but these errors were encountered: