dcsimg
Where to cache JNDI... ?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jonathan_Tam
Posted On:   Thursday, April 18, 2002 05:53 PM

JNDI lookups are expensive and I get the feeling that I should be cacheing these to an extent. For BMP, JBuilder code caches the Datasource upon setEntityContext, which occurs once when the bean is made. This seems alright. Can stateless session beans cache JNDI references to Entity Beans during ejbCreate()? Can I just lookup SomeEntityHome and keep it for the life of the Session bean? Is there a better way to do this? For JSPs I was thinking... a bean with a scope of application. The bean looks up some ejbHome via JNDI and then keeps the Home forever. Any page that needs to use ejbHome.create() can then reference that bean. Does this seem alright? Is is seriously flawed? How can I get a bean to do this thing j   More>>

JNDI lookups are expensive and I get the feeling that I should be cacheing these to an extent. For BMP, JBuilder code caches the Datasource upon setEntityContext, which occurs once when the bean is made. This seems alright.



Can stateless session beans cache JNDI references to Entity Beans during ejbCreate()? Can I just lookup SomeEntityHome and keep it for the life of the Session bean? Is there a better way to do this?



For JSPs I was thinking... a bean with a scope of application. The bean looks up some ejbHome via JNDI and then keeps the Home forever. Any page that needs to use ejbHome.create() can then reference that bean. Does this seem alright? Is is seriously flawed? How can I get a bean to do this thing just once? Does the constructor work for beans in this context?



Sorry if this was a bit long.



Thanks.

   <<Less
About | Sitemap | Contact