• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent:Please Help

 
Manav
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a new bee in ejb please tell me that if an application uses Session beans that performs database operations, then the data that’s is read by the session beans are cached for the lifetime of the application or for a single session or for a single method call or single transaction .
Thanks in advance
Manav
 
Karl Laird
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It really depends on whether they are stateless or stateful session beans.
For a stateless session bean it would (usually) be cached for the method call.
For a stateful session bean it would usually be cached for the life of the session bean (which is controlled by the bean lifecycles which is another topic in itself :-)
However DB access is often best performed through the use of session beans calling entity beans - which have entirely different caching entirely.
Part of the problem with relying on session bean caching is the caching is also dependent on how you are writing your db calls - there would be no caching at all if the method called itself preforms the db access - but doing otherwise can overly complicate transaction control and avoiding dirty reads.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic