Forum Stats

  • 3,852,530 Users
  • 2,264,112 Discussions
  • 7,905,096 Comments

Discussions

cx_oracle objects in python cgi session

147458
147458 Member Posts: 235
edited Jun 29, 2009 5:18PM in Python
Hi,

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.

thanks
~Gouri

Best Answer

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,654 Employee
    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)

Answers

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,654 Employee
    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)
  • 147458
    147458 Member Posts: 235
    Thankyou.

    That's only my requirement not my project's :) Anyway, thanks a lot.
This discussion has been closed.