X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/blobdiff_plain/660cc7e978be22c81752dd814aa21d9f56586e46..5641962504f19a365cbab009f88ba58d93dce0d2:/python/database/models.py diff --git a/python/database/models.py b/python/database/models.py index 236598a..80749ff 100644 --- a/python/database/models.py +++ b/python/database/models.py @@ -51,7 +51,7 @@ __all__ = ['meta', ] meta = ThreadLocalMetaData() -session = orm.scoped_session(orm.sessionmaker(transactional=False, autoflush=False)) +session = orm.scoped_session(orm.sessionmaker(autocommit=True, autoflush=False)) machine_table = Table('machines', meta, Column('machine_id', Integer, primary_key=True, nullable=False), @@ -190,4 +190,4 @@ def clear_cache(): """Clear sqlalchemy's cache """ - session.clear() + session.expunge_all()