[sqlalchemy-20] Use ``Session.get_transaction()``
"transaction" is no longer a public member in ``Session`` class. The method ``get_transaction`` should be used instead. Change-Id: I182dcd2f4ff9d6d0d1092c8f9967b4a5cc063242 Closes-Bug: #2004260
This commit is contained in:
parent
4cecce88c7
commit
59eebaa199
|
@ -309,7 +309,7 @@ def _load_one_to_manys(session):
|
||||||
if session.new:
|
if session.new:
|
||||||
session.flush()
|
session.flush()
|
||||||
|
|
||||||
if session.transaction.nested:
|
if session.get_transaction().nested:
|
||||||
# wait until final commit
|
# wait until final commit
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -479,8 +479,8 @@ def is_session_active(session):
|
||||||
if getattr(session, 'autocommit', None):
|
if getattr(session, 'autocommit', None):
|
||||||
# old behaviour, to be removed with sqlalchemy 2.0
|
# old behaviour, to be removed with sqlalchemy 2.0
|
||||||
return session.is_active
|
return session.is_active
|
||||||
if not session.transaction:
|
if not session.get_transaction():
|
||||||
return False
|
return False
|
||||||
if not session.transaction._connections:
|
if not session.get_transaction()._connections:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue