Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-12-2004, 11:26 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
Session storage on an intranet app.

I'm building this web app which will be used by 25 people max at a time.

I have a very detailed 'advanced customer search'. I want it to work like when you search for flights on orbitz, expedia, or most other big sites like that.

- execute the search
- view an animated gif that says 'searching'
- change the page to display the results.

since there are about a million records, the ability to use 'like' in the query, and possible joins happening depending on the search criteria, this may take some time.

the only way i can think to do this is by saving the result set to a session variable.

you think that is how the airline sites are doing it? my only concern would be hogging server resources, but the advanced search wouldn't really even get used that much.

any thoughts on this?
__________________
Mike
sde is offline   Reply With Quote
Old 07-12-2004, 11:32 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
Are you asking whether or not saving the result to to a session variable is a good idea or not?
__________________
GitS
Belisarius is offline   Reply With Quote
Old 07-12-2004, 11:37 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
Quote:
Originally posted by Belisarius
Are you asking whether or not saving the result to to a session variable is a good idea or not?
exactly, with the idea that it's only going to be used by a few users at a time.
__________________
Mike
sde is offline   Reply With Quote
Old 07-12-2004, 01:37 PM   #4 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
If this is in Java, there might be a problem with the ResultSet should you attempt to use the connection, as the ResultSet is dependant on the connection. Should you use the connection to do something else or close the connection (or should the connection be closed for you), it'll screw up the ResultSet.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 07-12-2004, 02:06 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
i suppose an array would work fine too .. just haven't ever stored that much information in a session. i guess it will be fine. i can always check the server
__________________
Mike
sde is offline   Reply With Quote
Old 07-12-2004, 03:27 PM   #6 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
Well, for what it's worth I'm storing about 10000 items in an array and it hasn't killed the server yet.

I will admit, I'm not sure of the best way to handle large sets of data.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 08-19-2004, 05:18 AM   #7 (permalink)
pipeten
Registered User
 
Join Date: Aug 2004
Posts: 1
pipeten is on a distinguished road
Good question.. what method did you opt for in the end and how did it go? (What language and OS too )
pipeten is offline   Reply With Quote
Old 08-19-2004, 05:56 AM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
for this project i'm using java. i've opted to store an array of search results ( my customer object )in a session variable.

it makes for very fast sorting and paging. there are a couple factors that influenced my decision.

1. i'm working with a db2 database on an as/400, and 'LIMIT' is not recognized by the db. this means i have to query all results anyway. ( and not just the first 20-50 that i display on the page )

2. queries take 500-2000 ms. when coupled with other queries can compromise performance of my web app.

i'm pretty happy with the results now.
__________________
Mike
sde is offline   Reply With Quote
Old 08-19-2004, 07:09 PM   #9 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
What about the FETCH FIRST $n ROWS ONLY statement? I remember it being used in the ADODB code.

Looks like OPTIMIZE FOR $n ROWS might also be an option.

-r
idx is offline   Reply With Quote
Old 08-23-2004, 05:59 AM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
i had to think to re-remember why that didn't work. yes, you are right, however how would you select the second set of 10 records?

select * from table limit 10,20

i think that was the problem. you can't fetch anything but the first set of 10.
__________________
Mike
sde is offline   Reply With Quote
Old 08-23-2004, 07:14 PM   #11 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
You would think there has to be some sql-specific way around that.. Looking at ADO a bit more it seems they use some internal chopping functions to return only the second set of 10. (although the first 20 are pulled from the db)

damn db2.

-r
idx is offline   Reply With Quote
Old 08-23-2004, 07:23 PM   #12 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
i'm not using ado though, i need to use a native jdbc driver to db2 via the javatoolbox for ibm as/400 midrange servers. .. ado is just microsoft right?
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
check if session variable is null? sde Java 3 07-07-2004 12:27 PM
session_start(): Cannot send session cookie learntophp PHP 2 06-18-2004 07:51 AM
c++.net console app ? sde Standard C, C++ 5 03-13-2003 06:07 AM


All times are GMT -8. The time now is 05:06 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting