-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
初始化数据库报错pony.orm.core.TransactionError: db_session is required when working with the database #4
Comments
mysql> show databases; mysql> 相应的数据库也没有建立 |
是 pony 最新版与之前不兼容的问题,我正在解决。 |
有进展么?我可以帮你做些设么? |
最近在工作,没时间改。 |
@yetone 好的,我试着去改改 |
一共有六个文件含有 @with_transaction , 都替换成 @db_session 后,这个问题还是存在。 下面是替换后的效果 Search "@db_session" (20 hits in 6 files) |
test@server:
/collipa-master$ python setup.py --init/collipa-master$Traceback (most recent call last):
File "setup.py", line 77, in
main(sys.argv[1:])
File "setup.py", line 38, in main
if not Node.get(id=1):
File "/usr/local/lib/python2.7/dist-packages/pony/utils.py", line 81, in new_func
return old_func(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/pony/orm/core.py", line 2240, in get
objects = entity.find(1, kwargs) # can throw MultipleObjectsFoundError
File "/usr/local/lib/python2.7/dist-packages/pony/orm/core.py", line 2280, in find
objects = entity.find_in_cache(pkval, avdict)
File "/usr/local/lib/python2.7/dist-packages/pony/orm/core.py", line 2288, in find_in_cache
cache = entity.get_cache()
File "/usr/local/lib/python2.7/dist-packages/pony/orm/core.py", line 2553, in get_cache
return database._get_cache()
File "/usr/local/lib/python2.7/dist-packages/pony/orm/core.py", line 345, in _get_cache
): throw(TransactionError, 'db_session is required when working with the database')
File "/usr/local/lib/python2.7/dist-packages/pony/utils.py", line 108, in throw
raise exc
pony.orm.core.TransactionError: db_session is required when working with the database
test@server:
The text was updated successfully, but these errors were encountered: