{python}
engine = create_engine('postgres://scott:tiger@localhost/test')
- Session = scoped_session(sessionmaker(transactional=True, autoflush=False, bind=engine))
+ Session = scoped_session(sessionmaker(autocommit=False, autoflush=False, bind=engine))
Base = declarative_base()
Mapped instances then make usage of `Session` in the usual way.
like::
engine = create_engine('postgres://scott:tiger@localhost/test')
- Session = scoped_session(sessionmaker(transactional=True,
+ Session = scoped_session(sessionmaker(autocommit=False,
autoflush=False,
bind=engine))
Base = declarative_base()
This clears all items and ends any transaction in progress.
- If this session were created with ``transactional=True``, a new
+ If this session were created with ``autocommit=False``, a new
transaction is immediately begun. Note that this new transaction does
not use any connection resources until they are first needed.