Forums Register Login

question about multiple instances of same ejb..

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
Certainly you can.
+Pie Number of slices to send: Send
Yes you can. With different JNDI names.
+Pie Number of slices to send: Send
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.
It runs on an internal combustion engine. This ad does not:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1135 times.
Similar Threads
servlet controller
Can we deploy multiple application on JBoss at the same time?
url pattern in web.xml
JVMs
What is Multiple Deployment of an EJB?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 09:16:17.