File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Stateless Session EJB saving at ServletContext? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Stateless Session EJB saving at ServletContext?" Watch "Stateless Session EJB saving at ServletContext?" New topic

Stateless Session EJB saving at ServletContext?

Pearlo Muthukumaran
Ranch Hand

Joined: Sep 17, 2002
Posts: 79
I have a stateless session EJB deployed in JBoss 3.0.2 and a normal clinet written for testing the EJb works perfectly. Now I am building a web interface factoring the design MVC way.
Could somebody tell me whether it is the best practise to put the session bean at the ServletContext?
Will this improve the application performance?
ie I would like to do something like
MyEJB a = MyEJBHome.create();
within the init method of the first servlet invoked within the application and all other servlets make use of this object - a of type MyEJB for further method invocations.
Please respond from the performance point of view.
Thanks in advance
zb cong
Ranch Hand

Joined: Jan 14, 2002
Posts: 416

i don't think it will generate any performance problem!
I agree. Here's the link:
subject: Stateless Session EJB saving at ServletContext?
Similar Threads
How to access session bean within another session bean ?
Confusion about "mappedName"
Stateless Bean Optimum PoolSize and Caching of StatelessBean
Calling a transactional method from non-transactional method in EJB
Need help on Glassfish and EJB lookup