how to store large arraylist across several user request efficiently?

Hi, I am writing a java servlet to process some large data.

Here is the process

1), user will submit a query,

2) servlet return a lot of results for user to make selection,

3). user submit their selections (with checkboxes).

4). servlet send back the complete selected items in a file.

The part I have trouble with (new to servlet) is that how I can store the results arraylist (or vector) after step 2 so I needn't re-search again in step 4.

I think Session may be helpful here. But from what I read from tutorial, session seems only store small item instead of large dataset. Is it possible for session to store large dataset? Can you point me to an example or provide some example code?

Thanks for your attention.

Mike

[790 byte] By [mike2009a] at [2007-10-2 13:25:10]
# 1

Yes , There are 2 solutions

1). As you have mentioned All those data

can be set in a Vector and encapsulated in the session object.

2). To store the entire selected items in a file on the server end and then use it.This can also reduce network traffic.

I have no examples on those..

Reg's

Maneesh G C

maneeshraj2000a at 2007-7-13 11:04:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
yeah, but the solution one will need a lot of data transfter between client and server, right? (all the results will be transfered back and forth twice). I have thought about solution 2, but would that increase the server IO workload?Will that be a problem?
mike2009a at 2007-7-13 11:04:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I dont think that you can do much about sending lots of data to the client since the user will need to see the entire list in order to make the selection. All you can do is mininise the traffic by reducing the level of details in the list. And give the detailed data once the user have made the selection only for the selected data

In both suggested approaches the step 2 will be same. just put your data structure in the session duting step 2 (As mentiond in suggestion 1) so you will avoid any aditional IO operations. You can get the values back from the session in step 4.

Session data is stored at the server what is send to the client is only a tiny cookie containing the session id.

LRMKa at 2007-7-13 11:04:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...