From 610c871aaa0710e054b2187178a3f019cae4013f Mon Sep 17 00:00:00 2001 From: xiaodongwang Date: Tue, 14 Oct 2014 11:55:09 -0700 Subject: [PATCH] remove lock for select Change-Id: Ie6dd683251f7e2b8ed6fe60431a205018eb41d92 --- compass/db/api/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compass/db/api/utils.py b/compass/db/api/utils.py index aa02d5bd..04352253 100644 --- a/compass/db/api/utils.py +++ b/compass/db/api/utils.py @@ -31,7 +31,7 @@ def model_query(session, model): if not issubclass(model, models.BASE): raise exception.DatabaseException("model should be sublass of BASE!") - return session.query(model).with_lockmode('update') + return session.query(model) def _default_list_condition_func(col_attr, value, condition_func): @@ -441,7 +441,7 @@ def get_db_object(session, table, exception_when_missing=True, **kwargs): model_query(session, table), table, **kwargs ).first() logging.debug( - 'session %s db object %s added', session, db_object + 'session %s got db object %s', session, db_object ) if db_object: return db_object