[elbe-devel] [PATCH] Replace deprecated SQLAlchemy method

Braunwarth, Daniel Daniel.Braunwarth at kuka.com
Wed Jun 9 13:31:09 CEST 2021


The with_lockmode method is deprecated since version 0.9 and has been
removed in version 1.4.

Signed-off-by: Daniel Braunwarth <daniel.braunwarth at kuka.com>
---
 elbepack/db.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/elbepack/db.py b/elbepack/db.py
index 0b8c2d130..caaf8aa3c 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -501,7 +501,7 @@ class ElbeDB:
         assert "busy" not in allowed_status
         with session_scope(self.session) as s:
             try:
-                p = s.query(Project).with_lockmode('update'). \
+                p = s.query(Project).with_for_update(). \
                     filter(Project.builddir == builddir).one()
             except NoResultFound:
                 raise ElbeDBError(
@@ -533,7 +533,7 @@ class ElbeDB:
 
         with session_scope(self.session) as s:
             try:
-                p = s.query(Project).with_lockmode('update'). \
+                p = s.query(Project).with_for_update(). \
                     filter(Project.builddir == builddir).one()
             except NoResultFound:
                 raise ElbeDBError(
-- 
2.32.0


More information about the elbe-devel mailing list