File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes question about multiple instances of same ejb.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "question about multiple instances of same ejb.." Watch "question about multiple instances of same ejb.." New topic
Author

question about multiple instances of same ejb..

Bob Walker Jr
Ranch Hand

Joined: Jun 02, 2003
Posts: 46
Can we deploy the same enterprise bean multiple times in a container?
Like we have in servlets, we can deploy the same servlet class with different servlet-names. Can we do it with EJBs?
Jianming Wang
Greenhorn

Joined: Jun 12, 2003
Posts: 4
Certainly you can.


Sun Certified Programmer Java 1.1<br />Sun Certified Developer for Java 2
Bob Simpson
Greenhorn

Joined: May 24, 2002
Posts: 3
Yes you can. With different JNDI names.
Rangarajan Suresh
Ranch Hand

Joined: Jan 08, 2002
Posts: 50
But be careful, when you try to use isIdentical on these multiple deployments.
Find Excerpt from EJB2 spec below:

6.9.2 Stateless session beans
All session objects of the same stateless session bean within the same home have the same object iden-tity,
which is assigned by the container. If a stateless session bean is deployed multiple times (each
deployment results in the creation of a distinct home), session objects from different homes will have a
different identity.
The isIdentical(EJBObject otherEJBObject) and isIdentical(EJBLocalOb-ject
otherEJBLocalObject) methods always returns true when used to compare object refer-ences
of two session objects of the same stateless session bean.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about multiple instances of same ejb..