2 Replies Latest reply on Jun 29, 2009 9:18 PM by 147458

    cx_oracle objects in python cgi session


      I am trying some web pages using python cgi and using cx_oracle for data retrieval.

      The page fetches many records and I wanted to display 10 records only at once.
      So I tried to save the cx_oracle connection obj and cursor object in session variable. but session variable is not supporting to save those variables. :(

      How do you guys do this? I dont want to connect and disconnect database every time. any method of doing this?

      I am new to web programming, but good in pl/sql.

        • 1. Re: cx_oracle objects in python cgi session
          This isn't possible with a stateless web model in your scenario. Even with a web-savvy language like PHP which allows "persistent connections" you have to re-execute the query each time you "page". This will see any new data other users have inserted.

          You'll need to rethink how the application will be used to see if the paging model will be OK.
          Also make sure the infrastructure can cope with frequent connections. (PHP with Oracle 11g connection pooling is a good alternative)
          • 2. Re: cx_oracle objects in python cgi session

            That's only my requirement not my project's :) Anyway, thanks a lot.