| Author |
Design Question EJBs and Servlets
|
Russell Ray
Ranch Hand
Joined: Apr 25, 2005
Posts: 116
|
|
Howdy to all: I have a simple design issue I wanted to bounce off the group. Most Web/J2EE application work let this: Web Server to Application Server (Servlet to EJB). I have some information on the Web Server that needs updating. My initial thought is to update it simply by calling a Servlet from the EJB and allow it to update the information on the Web Server. Here is my question: Is there a better way? Thanks for taking the time and reading my post. Russ
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
|
This somehow sounds fishy to me, but it's hard to tell without knowing more. Can you tell us what needs to be updated on the webserver, and why?
|
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
|
 |
Russell Ray
Ranch Hand
Joined: Apr 25, 2005
Posts: 116
|
|
|
Sure I would be glad to. It is cache.
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
|
What are you caching and why? Where does the cache get accessed from? When does it need to be updated?
|
 |
Russell Ray
Ranch Hand
Joined: Apr 25, 2005
Posts: 116
|
|
We put the cache on the application server for EJB use. We also put another cache on the Web Server for the presentation use. In some cases the presentation and the EJBs are using the same information from the cache but stored in two separate locations within the application. The reason for this is for performance and storing the information closest to the point of a request. Because we are using two caches for the application, we are keeping the cache updated on both servers. Updating two separate caches within an application is a chore, but it is doable[sic]. The update tasks associated with the EJB container is easy and straightforward. I am curious about updating the cache on the web server from the EJB container and discovering a better way from other experieince designers. Thanks for taking to time to read my post! Russell
|
 |
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
|
|
Are you sure you need both caches. That is, have you tried without them? *What* gets stored in the caches. Most importantly, what *specific* data gets stored in both caches? Why do you cache it? What is the costly thing you try to avoid - network traffic, calculation of the data, database access? Can you give a *specific* example of how the cache gets used (one that you are worried about)? Pleasy provide as many details as you can. Without that, it's really hard to imagine your situation...
|
 |
 |
|
|
subject: Design Question EJBs and Servlets
|
|
|