Which approach would you use?

J

James Yong

Hi,

We would normally cache some info to avoid accessing database everytime.
My question is whether it is ideal to keep such information (which isn't
huge in my case)
in the sessions of Tomcat (btw, i am not using EJB) which have native
implementation for session clustering.
Or should I just use a Cache like OSCache?

Regards,
James Yong
 
W

Wibble

James said:
Hi,

We would normally cache some info to avoid accessing database everytime.
My question is whether it is ideal to keep such information (which isn't
huge in my case)
in the sessions of Tomcat (btw, i am not using EJB) which have native
implementation for session clustering.
Or should I just use a Cache like OSCache?

Regards,
James Yong
Is this data used across multiple sessions?
 
H

HalcyonWild

No. The data is specific to each session.

You might want to keep user session specific common data (like
preferences) in the session.

If it is something that is used across all sessions, and common to all
users who log in, you might want a singleton cache. Data like State
Names like Arizona, Washington, NY, CA etc go here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top