Connection Pools Turn Session State Into Shared State
A database connection pool reuses physical sessions across many logical borrowers. That reuse changes the lifetime of session-scoped state. A setting applied by one request can outlive the request itself because returning a connection to the pool usually ends only the borrower’s access to that connection, not the database session behind it. This distinction matters whenever application code changes properties that belong to the session rather than to a single statement or transaction. Transaction isolation, read-only mode, schema selection, session variables, advisory locks, temporary objects, prepared statements, and database-specific configuration can all have lifetimes that differ from the lexical scope of application code.