[mod_python] Lock-Problem with Oracle

Hartmut Fröls h.froels at web.de
Fri Mar 14 09:16:07 EDT 2008


Hi Group,

I try to use mod_python to generate a browser-based GUI for a
small ERP-Application.
I use Apache 2.2, mod_python 3.3.1 and Python 2.4.4  with Oracle 9i2.

At first I wrote a programm  like this:

########################################
import db      # my database handlers with cx_Oracle

def index(req):

   ...               # generate a http-page with a form

   return http

def GetDat(req,**data):
      .....
      db.select(...... for_update=1)
      .....
      return data

def PutDat(req,**data):
      .....
      db.update(data)
      .....
      return succes

#########################################

The http-page has some AJAX-functions, which send and recieve
the datas the user needs or has updatet.

The problem is, when the programm makes the update on the
database, it waits for the lock, because the programm has opend
a second cursor for the update, although the cursor-objects should
be global. I know, after reading many of the postings in this group and all over
the web, that this is because mod_python opens a new request for
the call of the PutDat() function and this new interpreter-instance of
this request has its own global vars.
So I come to my question: is there any way to tell mod_python, that the
AJAX-request from the http-page must go to the interpreter-instance,
that has generatet the page ?  Or do You know any other solution for
this lock-problem ?

I hope anyone can help me.  (Sorry for my bad English)

- Hartmut

_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220




More information about the Mod_python mailing list