aspose file tools
The moose likes JBoss and the fly likes Caching EJB3 remote references prevents pooling or not Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "Caching EJB3 remote references prevents pooling or not" Watch "Caching EJB3 remote references prevents pooling or not" New topic
Author

Caching EJB3 remote references prevents pooling or not

Shayan Shah
Greenhorn

Joined: Aug 28, 2009
Posts: 25
Hi

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?

thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5536

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.


JBoss In Action
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Caching EJB3 remote references prevents pooling or not
 
Similar Threads
Hibernate + Multi User Swing App + JBoss
Doubt abt local and remote interfaces
lookup an EJB3 using local interface from helper classes in weblogic10
Unable to access Local SLSB from app client
Caching EJB3 remote references prevents pooling or not?