You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't understand what's going on here, but it fails
frompony.ormimport*db=Database()
classTestPost(db.Entity):
category=Optional('TestCategory')
classTestCategory(db.Entity):
posts=Set(TestPost)
db.bind('sqlite', ':memory:')
db.generate_mapping(create_tables=True)
withdb_session:
post=TestPost()
post.flush() # Remove one of these lines,post.category# and this will work fineprint('Created post id:', post.id)
Traceback:
File "/usr/lib/python3.5/site-packages/pony/orm/core.py", line 395, in __exit__
commit()
File "<string>", line 2, in commit
File "/usr/lib/python3.5/site-packages/pony/utils.py", line 65, in cut_traceback
return func(*args, **kwargs)
File "/usr/lib/python3.5/site-packages/pony/orm/core.py", line 291, in commit
transact_reraise(CommitException, exceptions)
File "/usr/lib/python3.5/site-packages/pony/orm/core.py", line 275, in transact_reraise
reraise(exc_class, new_exc, tb)
File "/usr/lib/python3.5/site-packages/pony/utils.py", line 92, in reraise
try: raise exc.with_traceback(tb)
File "/usr/lib/python3.5/site-packages/pony/orm/core.py", line 285, in commit
try: primary_cache.commit()
File "/usr/lib/python3.5/site-packages/pony/orm/core.py", line 1451, in commit
provider.commit(cache.connection, cache)
File "/usr/lib/python3.5/site-packages/pony/orm/dbproviders/sqlite.py", line 226, in commit
provider.transaction_lock.release()
pony.orm.core.CommitException: RuntimeError: release unlocked lock
MySQL works good
The text was updated successfully, but these errors were encountered:
kozlovsky
changed the title
sqlite3 and orm relation after flush: release unlocked lock
Incorrect transaction state after obj.flush() caused "release unlocked lock" error in SQLite
Feb 5, 2016
I don't understand what's going on here, but it fails
Traceback:
MySQL works good
The text was updated successfully, but these errors were encountered: