天天看点

cx_oracle 没有重连机制

conn = cx_Oracle.connect('test/[email protected]/serv')
def testconnect(request):
   xsql="select 'aaa' from dual"
   cur=conn.cursor()
   cur.execute(xsql)
   result = cur.fetchall()
   return HttpResponse(json.dumps(result), content_type="application/json")

OperationalError: ORA-03114: not connected to ORACLE
[04/Jul/2020 18:59:56] "GET /testconnect/ HTTP/1.1" 500 71092
Internal Server Error: /testconnect/
Traceback (most recent call last):
  File "/usr/local/python27/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/python27/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/python27/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    
           
上一篇: 级联查