Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading and Caching Entity Beans

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say at server startup I want to load an entire table say customer into memory.
Each entity bean maps to a row, how would I load each row into each entity bean in one call. So far all I have seen are examples of a session bean calling one entity bean.
Lets say I want to load a 100 customers, would I use one session bean with a loop calling each entity bean in turn. In all the examples I have seen the connection is created in the Entity bean, but if I use that method here then in my loop I would be opening and closing a connection 100 times.
The way I see it I would open the connection, then pass the connection to each entity bean home interface.
Is there another neater way, is there a way to configure a server like weblogic to set up this Entity Bean cache for me.
Thanks for any help Tony
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's called "Option A EJB Caching" and it's supported by all EJB servers. (Read the EJB spec for more information...) Do a search of the WebLogic documentation (or a google search) for "Option A" and you'll find out how to set it.
Kyle
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also -- are you only looking at BMP examples? Have you considered CMP?
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic