最近我出于性能原因将我正在从MySQL开发的Web应用程序移动到PostgreSQL(我需要PostGIS提供的功能).现在经常遇到以下错误:
current transaction is aborted, commands ignored until end of transaction block
服务器应用程序使用mod_python.hailing函数(即为此特定客户端创建新会话的函数)中发生错误.这里是适当的代码段(异常发生在调用sessionAppId的行上:
def hello(req):
req.content_type = "text/json"
req.headers_out.add('Cache-Control', "no-store, no-cache, must-revalidate")
req.headers_out.add('Pragma', "no-cache")
req.headers_out.add('Expires', "-1")
instance = req.hostname.split(".")[0]
cookieSecret = '....' # whatever :-)
receivedCookies = Cookie.get_cookies(req, Cookie.SignedCookie, secret = cookieSecret)
sessionList = receivedCookies.get('sessions', None)
sessionId = str(uuid.uuid4())
if sessionList:
if type(sessionList) is not Cookie.SignedCookie:
return "{status: 'error', errno:1, errmsg:'Permission denied.'}"
else:
sessionList = sessionList.value.split(",")
for x in sessionList[:]:
revisionCookie = receivedCookies.get('rev_' + str(sessionAppId(x, instance)), None)
# more processing …Run Code Online (Sandbox Code Playgroud)