File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 47
47
def _create_facade_lazily ():
48
48
global _FACADE
49
49
if _FACADE is None :
50
- # FIXME(karolinku): autocommit=True it's not compatible with
51
- # SQLAlchemy 2.0, and will be removed in future
52
- _FACADE = db_session .EngineFacade .from_config (CONF , autocommit = True )
50
+ _FACADE = db_session .EngineFacade .from_config (CONF )
53
51
if profiler_sqlalchemy :
54
52
if CONF .profiler .enabled and CONF .profiler .trace_sqlalchemy :
55
53
profiler_sqlalchemy .add_tracing (sa , _FACADE .get_engine (), "db" )
Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ def save(self, session=None):
93
93
if session is None :
94
94
session = db_api .get_session ()
95
95
96
- super (MagnumBase , self ).save (session )
96
+ with session .begin ():
97
+ super (MagnumBase , self ).save (session )
97
98
98
99
99
100
Base = declarative_base (cls = MagnumBase )
You can’t perform that action at this time.
0 commit comments