python项目出错,隔一段时间就会异常,各位过来看下怎么解决。。。
时间:2011-07-04
来源:互联网
[29 17:21:42]: call_request ERROR 处理异常: Traceback (most recent call last):
File "/server/pstn_proxy/call_request.py", line 50, in mainProc
commanderMap[command](channel_no, command, content)
File "/server/pstn_proxy/sm.py", line 333, in request
request_person(netx_channel, command, req)
File "/server/pstn_proxy/sm.py", line 545, in request_person
subcode, a, b = sm_subcode.get_subcode(req['uid'], '0001', req['phonenum'], 1, 1)
File "/server/pstn_proxy/sm_subcode.py", line 57, in get_subcode
cs.execute("SELECT subcode, identifier FROM subcode WHERE pvdcode = '%s' AND phone = '%s'" %(pvdcode, phone))
File "/usr/local/lib/python2.5/site-packages/DBUtils-0.9.4-py2.5.egg/DBUtils/SteadyDB.py", line 335, in tough_method
result = method(*args, **kwargs) # try to execute
File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 147, in execute
charset = db.character_set_name()
InterfaceError: (0, '')
google搜索的结果是:
Try passing the cursor and not the connection -
import MySQLdb
import module_name
connection = MySQLdb.connect(host='localhost', user='user',
passwd='password', db='database')
cursor = connection.cursor()
module = module_name.ClassName(cursor)
但是项目里面的数据库连接部分大概是这样的:
from DBUtils.PersistentDB import PersistentDB
persist = PersistentDB(creator=dbdriver,**DSN_DB)
cs = config.persist.connection().cursor(config.persist._creator.cursors.DictCursor)
在线等结果!!!先谢谢!!!
谷歌的链接 http://objectmix.com/python/17526-re-mysql-interfaceerror.html
File "/server/pstn_proxy/call_request.py", line 50, in mainProc
commanderMap[command](channel_no, command, content)
File "/server/pstn_proxy/sm.py", line 333, in request
request_person(netx_channel, command, req)
File "/server/pstn_proxy/sm.py", line 545, in request_person
subcode, a, b = sm_subcode.get_subcode(req['uid'], '0001', req['phonenum'], 1, 1)
File "/server/pstn_proxy/sm_subcode.py", line 57, in get_subcode
cs.execute("SELECT subcode, identifier FROM subcode WHERE pvdcode = '%s' AND phone = '%s'" %(pvdcode, phone))
File "/usr/local/lib/python2.5/site-packages/DBUtils-0.9.4-py2.5.egg/DBUtils/SteadyDB.py", line 335, in tough_method
result = method(*args, **kwargs) # try to execute
File "build/bdist.linux-i686/egg/MySQLdb/cursors.py", line 147, in execute
charset = db.character_set_name()
InterfaceError: (0, '')
google搜索的结果是:
Try passing the cursor and not the connection -
import MySQLdb
import module_name
connection = MySQLdb.connect(host='localhost', user='user',
passwd='password', db='database')
cursor = connection.cursor()
module = module_name.ClassName(cursor)
但是项目里面的数据库连接部分大概是这样的:
from DBUtils.PersistentDB import PersistentDB
persist = PersistentDB(creator=dbdriver,**DSN_DB)
cs = config.persist.connection().cursor(config.persist._creator.cursors.DictCursor)
在线等结果!!!先谢谢!!!
谷歌的链接 http://objectmix.com/python/17526-re-mysql-interfaceerror.html
作者: youbiyun 发布时间: 2011-07-04
数据库是什么,负载怎么样?
我觉得有可能是连接数过多造成的。
我觉得有可能是连接数过多造成的。
作者: friendmine 发布时间: 2011-07-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28