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?
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)
My pie came with a little toothpic holding up this tiny ad: