When should I use a session template per request

I see this pattern everywhere, but Linq to SQL does not implement it. If Session / Unit-of-Work objects are lightweight (can be created and destroyed without sacrificing performance), and the connection pool supports live database connections, why and when do I need a session template for the request?

+3
source share
2 answers

I believe that the idea of ​​a per-session session is more about opening and closing a session, rather than improving performance.

The idea is that

  • Opening a session will begin a transaction before your code is ever called
  • -
  • , ,

№2 , - ; getter , , , .

+3

, , -, .

, .

0

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


All Articles