• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Suggestion for filter saving

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,

I'm having a web reporting system developed using J2EE. There are several reports and each of these reports have several columns(8 on an average). The column data can be sorted and filtered.

I have to write a logic to enable the saving of sort and filter for a particular user.

There are 2 flavors here, one is the permanent saving of data, where the data will be saved in the Database. The second one is the temporary saving of data, where the filter/sort data will be saved till the session exists.

Now every time the user makes any filter to any report, I need to save that data so that if the user browses through some other report and comes back, he should see the filtered report.

Now, there are again two options for me to save. The first one is saving the data to session and accessing it from the session variables.
The second one is database again where every time a filter is used, the values will be stored to the DB.



Storing data in the session seems to be a better option for me considering the frequent DB operations to store the temporary data.

My question here is that, is it advisable to store this data to session ? Whats the recommended suggestion for storing the temporary data ?


Thanks,
Aditya

 
Adi Kulkarni
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just need inputs on whether the session object can be used to significant data.

What is the memory allocated to a session object and does it tend to overflow if the data size increases ?

Kindly help me with this query.

Thanks,
Aditya
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I just need inputs on whether the session object can be used to significant data.
What is the memory allocated to a session object and does it tend to overflow if the data size increases ?
Kindly help me with this query.



Maybe and then again maybe not

If you are looking for a specific number, it isn't there. It depends on the hardware you use for the server, the memory allocated to the heap, the size and tenure of other objects (besides the session) that uses the heap, the session passivation interval set on your server and many more things.

In effect, you'll have to profile/performance test your application mimicking various load conditions to arrive at a safe answer.

cheers,
ram.

 
Adi Kulkarni
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

So does that mean I can implement it using session for now ?

 
Sheriff
Posts: 7134
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adi Kulkarni wrote:So does that mean I can implement it using session for now ?


Yes, having a memory overflow just because of storing data on sessions is not that often with the modern day hardware infrastructures. You can implement the session storage and perform some stress testing to find out how it really affects. If it's getting bigger, you may need some horizontal scaling on a distributed environment.
 
Adi Kulkarni
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Devaka,

I shall implement using session then.

~Aditya
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic