Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

When is it acceptable to cache remote references on the client(servlet)?  RSS feed

 
Jim Clayson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When, if at all, is it acceptable to cache ejb remote references on the client(servlet engine)? I'm thinking mainly about stateless session beans because entity beans which are behind a facade would not have references exposed to the client anyway.
If the answer to this is long then a reference to the info would be great!
Thanks!
Jim
I guess the same question would apply to inter-entity bean references.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pretty much always cache the Home interface. The only penalty is that if the EJB is hot-deployed, you won't be getting the updated EJB.
As for long-term holding on EJBs themselves, doing so deprives them of the benefits of caching and similar performance-enhancing mechanisms, so you should make sure that what you gain is going to me more than what you lose.
 
Jim Clayson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Ok I see what you're saying. But how does a remote ejb server know there is a home reference being cached in a remote servlet engine? i.e. How does it know a home refrence is still being referenced?
Is this an rmi thing?
Cheers
Jim
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't. I'm talking about having the client do the caching. If you need hot updates to the cache, the client is going to hafe to be provided with a mechanism that lets it know that the cache is stale.
In the most common case, the "client" is the web app, and so you can put an extra admin page into the web app to set a flag. For a case where you're talking caching on a REMOTE client, the same general principle applies, but, naturally, there'd be more overhead.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!