• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

What is Multiple Deployment of an EJB?

 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose one example is deploying a session bean that is both stateful and stateless.
 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic