• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Loading and Caching Entity Beans  RSS feed

 
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
 
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!