• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Design Question EJBs and Servlets

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure I would be glad to. It is cache.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you caching and why? Where does the cache get accessed from? When does it need to be updated?
 
Russell Ray
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic