I'm using sqlalchemy to access MySQL (through Innodb). The query I use for
lock is:
create_engine('mysql+mysqldb://root:root@localhost/tmp_db')
db_session = scoped_session(sessionmaker(bind=engine))
db_session.query(Transaction).filter_by(key='abc').with_lockmode('update').first()
There is no key = 'abc' found in table. However, the whole transaction
table is locked by this (I checked from show engine innodb status). Other
db session can't access any row in the table, and get timeout error.
Why the whole table is locked for no record found when using with_lockmode?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/a2DctR6IHfMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.