This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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