|
 |
|
 |
07-12-2004, 11:26 AM
|
#1 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
07-12-2004, 11:32 AM
|
#2 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,140
|
Are you asking whether or not saving the result to to a session variable is a good idea or not?
|
|
|
07-12-2004, 11:37 AM
|
#3 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
07-12-2004, 01:37 PM
|
#4 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,140
|
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.
|
|
|
07-12-2004, 02:06 PM
|
#5 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
07-12-2004, 03:27 PM
|
#6 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,140
|
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.
|
|
|
08-19-2004, 05:18 AM
|
#7 (permalink)
|
|
Registered User
Join Date: Aug 2004
Posts: 1
|
Good question.. what method did you opt for in the end and how did it go? (What language and OS too  )
|
|
|
08-19-2004, 05:56 AM
|
#8 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
08-19-2004, 07:09 PM
|
#9 (permalink)
|
|
Senior Grasshopper
Join Date: Jun 2003
Location: FL
Posts: 317
|
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
|
|
|
08-23-2004, 05:59 AM
|
#10 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
08-23-2004, 07:14 PM
|
#11 (permalink)
|
|
Senior Grasshopper
Join Date: Jun 2003
Location: FL
Posts: 317
|
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
|
|
|
08-23-2004, 07:23 PM
|
#12 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,446
|
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
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 05:06 AM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|