Re: [sqlalchemy] How to implement a conditional insert (MySQL)

2017-12-05 Thread Mike Bayer
is that session using "autocommit" mode? it looks like the error is raised on the UNLOCK ? On Wed, Dec 6, 2017 at 12:24 AM, wrote: > Once again I'm at a loss. > > I tried this: > > dbsession.execute("LOCK TABLES tokens WRITE") > dbsession.execute(cond_insert) # As per above discussio

Re: [sqlalchemy] How to implement a conditional insert (MySQL)

2017-12-05 Thread jens . troeger
Once again I'm at a loss. I tried this: dbsession.execute("LOCK TABLES tokens WRITE") dbsession.execute(cond_insert) # As per above discussion. dbsession.execute("UNLOCK TABLES") which raises an error: 1100, "Table 'tokens' was not locked with LOCK TABLES". Then I read that the tem