)]}'
{"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"8168b3ccd8b5331b8a091034e975b17d1c2ec004","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"    # session may not immediately issue an SQL query to a database"},{"line_number":1402,"context_line":"    # and instead just schedule it whereas we need to make sure to"},{"line_number":1403,"context_line":"    # issue a query immediately."},{"line_number":1404,"context_line":"    insert \u003d models.NamedLock.__table__.insert()"},{"line_number":1405,"context_line":""},{"line_number":1406,"context_line":"    session.execute(insert, {\u0027name\u0027: name})"},{"line_number":1407,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_c18e2c2d","line":1404,"range":{"start_line":1404,"start_character":30,"end_line":1404,"end_character":39},"updated":"2016-08-17 13:47:58.000000000","message":"I don\u0027t like the idea of getting dundered parameters of class. Why not use session.commit? http://docs.sqlalchemy.org/en/latest/orm/session_api.html#sqlalchemy.orm.session.Session.commit","commit_id":"b39f285d7103be309a1e8689cee1ebeb41e64088"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"affd57de91b82ae112e1b7893341a204cd477dc0","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"    # session may not immediately issue an SQL query to a database"},{"line_number":1402,"context_line":"    # and instead just schedule it whereas we need to make sure to"},{"line_number":1403,"context_line":"    # issue a query immediately."},{"line_number":1404,"context_line":"    insert \u003d models.NamedLock.__table__.insert()"},{"line_number":1405,"context_line":""},{"line_number":1406,"context_line":"    session.execute(insert, {\u0027name\u0027: name})"},{"line_number":1407,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ac06dbe_b1baaedf","line":1404,"range":{"start_line":1404,"start_character":30,"end_line":1404,"end_character":39},"in_reply_to":"3ac371cc_af01d63b","updated":"2016-08-22 06:25:07.000000000","message":"I didn\u0027t find an alternative either. As far as a separate session, no. Because a new session will be related to a new transaction. But we need it in the same current transaction.","commit_id":"b39f285d7103be309a1e8689cee1ebeb41e64088"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"f935bed6017bf1e0add71634f86323376c92d6f9","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"    # session may not immediately issue an SQL query to a database"},{"line_number":1402,"context_line":"    # and instead just schedule it whereas we need to make sure to"},{"line_number":1403,"context_line":"    # issue a query immediately."},{"line_number":1404,"context_line":"    insert \u003d models.NamedLock.__table__.insert()"},{"line_number":1405,"context_line":""},{"line_number":1406,"context_line":"    session.execute(insert, {\u0027name\u0027: name})"},{"line_number":1407,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_d9e71caa","line":1404,"range":{"start_line":1404,"start_character":30,"end_line":1404,"end_character":39},"in_reply_to":"3ac371cc_c18e2c2d","updated":"2016-08-18 02:20:55.000000000","message":"We can\u0027t use session commit() or flush()  because they flush all changes to DB. But we need to issue only this query. I think it\u0027s totally fine to use __table__ because it\u0027s a well known attribute of db models. We also use it explicitly in models.py to create indexes and constraints.","commit_id":"b39f285d7103be309a1e8689cee1ebeb41e64088"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"654c06bc01da1705ebcd84580fa6a1b65876bd0f","unresolved":false,"context_lines":[{"line_number":1401,"context_line":"    # session may not immediately issue an SQL query to a database"},{"line_number":1402,"context_line":"    # and instead just schedule it whereas we need to make sure to"},{"line_number":1403,"context_line":"    # issue a query immediately."},{"line_number":1404,"context_line":"    insert \u003d models.NamedLock.__table__.insert()"},{"line_number":1405,"context_line":""},{"line_number":1406,"context_line":"    session.execute(insert, {\u0027name\u0027: name})"},{"line_number":1407,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_af01d63b","line":1404,"range":{"start_line":1404,"start_character":30,"end_line":1404,"end_character":39},"in_reply_to":"3ac371cc_d9e71caa","updated":"2016-08-19 09:31:07.000000000","message":"Oh OK. I\u0027ve done some digging through the internet but didn\u0027t find an easy way to achieve this.\n\nIt seems to me that the only alternative is to use separate session for this, but I\u0027m not a fan of the idea. What do you think?","commit_id":"b39f285d7103be309a1e8689cee1ebeb41e64088"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"8168b3ccd8b5331b8a091034e975b17d1c2ec004","unresolved":false,"context_lines":[{"line_number":1416,"context_line":"    # session may not immediately issue an SQL query to a database"},{"line_number":1417,"context_line":"    # and instead just schedule it whereas we need to make sure to"},{"line_number":1418,"context_line":"    # issue a query immediately."},{"line_number":1419,"context_line":"    delete \u003d models.NamedLock.__table__.delete()"},{"line_number":1420,"context_line":""},{"line_number":1421,"context_line":"    session.execute(delete, {\u0027name\u0027: name})"},{"line_number":1422,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3ac371cc_417b5c28","line":1419,"range":{"start_line":1419,"start_character":30,"end_line":1419,"end_character":39},"updated":"2016-08-17 13:47:58.000000000","message":"ditto","commit_id":"b39f285d7103be309a1e8689cee1ebeb41e64088"}]}
