This was generated by a long SQL query that could take up to 12 seconds and here was my plan:
1) spawn a extra thread to pull the sql
2) when the sql was done update a flag in the users session
3) When Securepage.py saw that flag it added a "Report Done / View Report" link to the users menu
4) The thread took the entire result set and stuck into the session as a list of lists (Python strings and mxDateTime objects only)
5) Then the user could browser that list, resort it by any col, whatever they wanted.
6) For rendering to HTML I used Cheetah Templates in a nested loop and only render the section of the HTML that the user is viewing
I use Dynamic Sessions but have only about 50 users at a time on a big server (4 Gig ram, SCSI RAIS , Dial PIII)
-Aaron
Max Ischenko wrote:
Hi. I have a servlet which prompts user for some values, then search the database using entered keys and the display the result back to the user. I want to break results into pieces so it would load more quickly and reduce server loading (generating HTML from 3000 records take quite a few time).Currently, it's done as this: - select servlet accepts input keys, runs a SQL SELECT, stores returned SQL cursor to the session and redirects to browser servlet. - browser servlet uses c.fetchmany() to get next chunk of data and display it. The 'Next' button does another c.fetchmany() and redirects to itself. These scheme is ugly and has drawbacks. Does someone know a better solution? Main problems are: - can't reliably determine when cursor is no longer needed to close it - can't browse backward (also user can press Back button) PS: Btw, how can I put a link into HTML page to get back (like pressing Back button)? I vaguelly recall that it should be some magic js spell.
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss