On Mon, Feb 5, 2018 at 8:15 AM, Jacek Blocki wrote:
> Mike,
> Thank you for for the tip on _sessions, I think it is worth publishing since
> it can make debugging easier. Regarding documentation it will be good to
> mention session close() is not like file close() and closed
Mike,
Thank you for for the tip on _sessions, I think it is worth publishing
since it can make debugging easier. Regarding documentation it will be good
to mention session close() is not like file close() and closed session is
just ready for another transaction. Context manager is typically
On Wed, Jan 31, 2018 at 8:37 AM, Jacek Blocki wrote:
> In SQLAlchemy documentation there is an example of handling session with
> context manager:
>
> from contextlib import contextmanager
>
> @contextmanager
> def session_scope():
> """Provide a transactional scope
In SQLAlchemy documentation there is an example of handling session with
context manager:
from contextlib import contextmanager
@contextmanagerdef session_scope():
"""Provide a transactional scope around a series of operations."""
session = Session()
try:
yield session