Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Caching EJB3 remote references prevents pooling or not

Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have a client application that uses EJB3 beans by remote lookup. For performance reasons I cache the results of EJB3 lookups in a map.
Now does this force the client application to always use the same EJB3 instance as same reference is used again and again or does EJB pooling still works and returns other instances from the pool for requests handling?

Posts: 5856
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you are talking about stateless session beans. Caching the EJB is worthwhile because it eliminates the need to repeatedly call JNDI to find the EJB. But there is no link between the EJB proxy and the stateless session bean - each call you make is routed to an available bean in the pool.

The story is very different for stateful session beans - all calls made thought a specific proxy invoke the same stateful session bean. If you look up a new proxy via JNDI you will get a new stateful session bean.
Every plan is a little cooler if you have a blimp. And a tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic