Faking Entity Beans in Tomcat?

A

Andoni

Hello,

Maybe what I want is not to fake entity beans but I will explain what I am
trying to achieve. Each time a user logs on to my website the incur a
number of database queries. Firstly to get their details, then the list of
their suppliers and the list of their permissions on the site.

I want to store this information at application level so as to cut out many
of the DB queries that are being done, but there are a few problems:
1. It has to be possible to update any user in real time or to create a new
one and have them function immediately.
2. I don't know if there would be too much information being stored at
application level?
3. I am limited to Apache Tomcat and hence no Entity beans (which I believe
take care of these things?).

Can anyone suggest a pattern for doing this?

Thanks in advance,

Andoni.
 
M

Murray

1. It has to be possible to update any user in real time or to create a new
one and have them function immediately.

If it wasn't for this requirement, you could simply stick the user data into
the session. I assume you mean you want to be able to modify the user's
state from some other "place" in the application, i.e. outside the user's
session by an admin user or something along those lines. Is that what you
mean?

2. I don't know if there would be too much information being stored at
application level?

Well obviously that depends on the amount of data involved, how many users
will be using the site concurrently, and the amount of memory available on
the server. All things that only you know at the moment ;-) But if the
queries to grab the data take a while, then I'd say it's an acceptable
compromise to store the data in memory to improve performance, as long as
it's not a massive amount of data.
 
A

Andoni

Yes, I have an admin application which allows me add/change/delete users'
details. This would have to synch with the data stored in application
level.

I don't have too many users at the moment so I don't see holding the data in
application (ServletContext) level being a problem.

Surely the data couldn't be held in session level as each user creates a new
separate session when they log in?

Another aspect I have started to consider is that this site should be
distributable across two Tomcat servers. Would I be right in saying that
this is going to be a problem if I'm storing the data at application level?
I am going to have to check the user's details in application and then if
they are not there check the database for them and pull them into
application. I think I'll do that anyway, then I'll be ready for making it
distributable! Am I right?

Andoni.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top