diff options
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/orm/session.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 4f51d04c6..b0593ec69 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -508,6 +508,14 @@ class Session(object): self.twophase = twophase self._query_cls = query_cls + if autocommit: + if expire_on_commit and _enable_transaction_accounting: + util.warn("expire_on_commit=False is recommended with autocommit=True, " + "else excessive SELECT statements may be emitted.") + if autoflush: + util.warn("autoflush=False is recommended with autocommit=True, " + "else premature/excessive amounts of transaction commits may occur.") + if extension: for ext in util.to_list(extension): SessionExtension._adapt_listener(self, ext) |