Is the connection pool working correctly in Subsonic?

I get messages that the connection pool does not work in Subsonic orm when used with a SQL server on a remote machine. I'm not sure how they control this, perhaps with a profiler.

Subsonic opens later, closes earlier than you should do in the orm layer, but are there any problems with the implementation that will cause too many connections?

+1
source share
4 answers

There is a way to connect to stay open while using SubSonic. Many people assume that when you download a collection, the reader will be closed to you - but this is not the case (a class should not act in another class without permission). For this reason, there is a method called "LoadAndCloseReader ()".

If you could find out more, that would be great.

+7
source

Does this mean that SubSonic connections are permanent by default?

+1
source

, 2.1, AbstractList.Load() LoadAndCloseReader (rdr), using.

+1

, .

, :

MyTableCollection objCol = new MyTableCollection().Load();

it should be used as:

MyTableCollection objCol = new MyTableCollection();
objCol.LoadAndCloseReader(MyTable.FetchAll());
0
source

Source: https://habr.com/ru/post/1717468/


All Articles