Esempio n. 1
0
def ngw_txn(ngw_env):
    with manager as t:
        yield t
        try:
            DBSession.flush()
            t.abort()
        finally:
            DBSession.expunge_all()
            DBSession.expire_all()
Esempio n. 2
0
def txn():
    from nextgisweb.models import DBSession
    from transaction import manager
    _env_initialize()
    with manager as t:
        yield t
        try:
            DBSession.flush()
            t.abort()
        finally:
            DBSession.expunge_all()
            DBSession.expire_all()