• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and direct update of DBs  RSS feed

 
Gavin Bong
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose that I have a read only entity bean B representing table b. And table b is updated only via some external batch script. Does that external update mess up the caching for the bean B ? How does the bean's ejbLoad() know when to refresh its data ?
Thanks
Gavin
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid you have to give up on the caching... The EJB Container cannot know when the update has occurred and thus cannot implement meaningful caching.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set the timeout for calling the ejbLoad method in BEA weblogic
http://edocs.bea.com/wls/docs70/ejb/reference.html#1234237
 
Bhupesh Kokate
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pradeep,
Can we do the same in Websphere?
Bhupesh
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
You can set the timeout for calling the ejbLoad method in BEA weblogic
http://edocs.bea.com/wls/docs70/ejb/reference.html#1234237

If you are using WebLogic you can also manually invalidate a read-only bean's cache: Invalidating Read-Only Cached Data.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Chris! I had missed that feature completely.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!