)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"3aa2b4f664c8401d95e3d62df8524d6839647525","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     wangxiyuan \u003cwangxiyuan@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-06-02 09:25:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use session to avoid multi-threading problem with sql bakcend"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now zaqar\u0027s sql backend always use only one connection"},{"line_number":10,"context_line":"to db. It will lead an multi-thread problem:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_44aca7ed","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":61},"updated":"2016-06-04 20:03:03.000000000","message":"There\u0027s a typo in a word \"back end\". Also git commit subject can\u0027t be longer than 50 characters.\n\nMaybe use \"Avoid multi-threading problem with sql back end\"?","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"3ad28bd78b747c5c786bbb20dba98d107cc43228","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     wangxiyuan \u003cwangxiyuan@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-06-02 09:25:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Use session to avoid multi-threading problem with sql bakcend"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Now zaqar\u0027s sql backend always use only one connection"},{"line_number":10,"context_line":"to db. It will lead an multi-thread problem:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7aa08908_71c4fc91","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":61},"in_reply_to":"7aa08908_44aca7ed","updated":"2016-06-06 01:52:19.000000000","message":"Done","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"}],"zaqar/storage/sqlalchemy/driver.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"ecd154d70099a4669d16fe1aa811bf70f34b6963","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def run(self, *args, **kwargs):"},{"line_number":72,"context_line":"        # use scoped_session to avoid multi-threading problem."},{"line_number":73,"context_line":"        session \u003d scoped_session(sessionmaker(bind\u003dself.engine,"},{"line_number":74,"context_line":"                                              autocommit\u003dTrue))"},{"line_number":75,"context_line":"        res \u003d session().execute(*args, **kwargs)"},{"line_number":76,"context_line":"        return res"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9abb7d3a_6244f6b6","line":74,"updated":"2016-06-03 11:57:48.000000000","message":"Can we have a `session` property?","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"25b41c8cfbd15c15f539874fe64d1a9cb45d8c31","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def run(self, *args, **kwargs):"},{"line_number":72,"context_line":"        # use scoped_session to avoid multi-threading problem."},{"line_number":73,"context_line":"        session \u003d scoped_session(sessionmaker(bind\u003dself.engine,"},{"line_number":74,"context_line":"                                              autocommit\u003dTrue))"},{"line_number":75,"context_line":"        res \u003d session().execute(*args, **kwargs)"},{"line_number":76,"context_line":"        return res"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_f0b90aee","line":74,"in_reply_to":"7aa08908_c93552f8","updated":"2016-06-05 18:24:58.000000000","message":"Hm. I think my paste in the message above is a bit wrong. Here is the updated paste: http://paste.openstack.org/show/mncvmRLlPOY8GjFszwXp/\n(In the original paste I put parentheses near \u0027session\u0027 in a bad place. See \"don’t do this:\" example in http://docs.sqlalchemy.org/en/latest/orm/session_basics.html)","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"3ad28bd78b747c5c786bbb20dba98d107cc43228","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def run(self, *args, **kwargs):"},{"line_number":72,"context_line":"        # use scoped_session to avoid multi-threading problem."},{"line_number":73,"context_line":"        session \u003d scoped_session(sessionmaker(bind\u003dself.engine,"},{"line_number":74,"context_line":"                                              autocommit\u003dTrue))"},{"line_number":75,"context_line":"        res \u003d session().execute(*args, **kwargs)"},{"line_number":76,"context_line":"        return res"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_91bb680e","line":74,"in_reply_to":"7aa08908_f0b90aee","updated":"2016-06-06 01:52:19.000000000","message":"Done","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"},{"author":{"_account_id":18683,"name":"Eva Balycheva","email":"ubershy@gmail.com","username":"eva"},"change_message_id":"3aa2b4f664c8401d95e3d62df8524d6839647525","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def run(self, *args, **kwargs):"},{"line_number":72,"context_line":"        # use scoped_session to avoid multi-threading problem."},{"line_number":73,"context_line":"        session \u003d scoped_session(sessionmaker(bind\u003dself.engine,"},{"line_number":74,"context_line":"                                              autocommit\u003dTrue))"},{"line_number":75,"context_line":"        res \u003d session().execute(*args, **kwargs)"},{"line_number":76,"context_line":"        return res"},{"line_number":77,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_c93552f8","line":74,"in_reply_to":"9abb7d3a_6244f6b6","updated":"2016-06-04 20:03:03.000000000","message":"Do you mean store \u0027session\u0027 as a property of ControlDriver class, so we can reuse \u0027session\u0027 instead of creating it on each invocation of \u0027run\u0027 method?\n+1 then\n\n\nI came up with something like this: http://paste.openstack.org/show/eKq7tyhO0kURRhKygyzp/ ?\n(I made \u0027connection\u0027 property return \u0027session\u0027, and \u0027close\u0027 method close the \u0027sessio\u0027).\nWith this code the tempest tests pass, and also this code doesn\u0027t make \u0027connection\u0027 property and \u0027close\u0027 method \"useless\" like in the current patch set.\nDo you like it?","commit_id":"9b62dc892b39248fef708abbe75c580ca326a15d"}]}
