aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes What is Multiple Deployment of an 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 "What is Multiple Deployment of an EJB?" Watch "What is Multiple Deployment of an EJB?" New topic
Author

What is Multiple Deployment of an EJB?

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Just come across a mock question which looks like this:
Correct or not:
1 Multiple deployments of the same enterprise bean result in the same home.
Answer is "incorrect" because section 20.2 of the spec says 'multiple homes created' instead of 'same home'. I got this question right because I so happen do remember this statement made by the spec.
But, my problem is what is the exact meaning of "multiple deployments of the same enterprise bean"? I cannot visualize this situation in J2EESDK 1.3. Here, when we deploy, we deploy the EAR file into the container, we are not deploying individual ejb?
Can anyone illustrate this multiple deployment with a real life example?
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
I suppose one example is deploying a session bean that is both stateful and stateless.
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
Originally posted by Louis Saha:
I suppose one example is deploying a session bean that is both stateful and stateless.

An implementation of a session bean would be either stateful or stateless, not both AFAIK.
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
Originally posted by Billybob Marshall:

An implementation of a session bean would be either stateful or stateless, not both AFAIK.

Actually, you can declare a session bean as both, I can't tell you why you would do that, but it is possible. HFEJB mentions it but can't give u page # right no.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
The problem is with the word 'deployment'. The 20.2 of the spec tries to make it clear what it means by 'deployment'. Basically, if you have a different JNDI name, you have a different deployment. It isn't talking about is using the container's tools to give the exact same files to the container over and over again. As developers we tend to think of that last act as the 'deployment', but the spec is concerned with defining the consequences of the work done by the deployer.
So, for example, if you used the same class files but defined two different session-bean entries in your ejb-jar.xml file (e.g. if you wanted to provide each with different <env-entry> values), then you would have two deployments. Two different homes would be created. Each bean type would be created from the same files, but their execution behaviour could differ according to the impact of the differences in the deployment information.


Reid - SCJP2 (April 2002)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is Multiple Deployment of an EJB?