Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@EJB injection to servlet

 
Krzysztof Miarecki
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets assume, that we have a servlet with dependency injected ejb into instance field:


Servlet and EJB run on different JVMs (and different machines).
How it works?
1. Injected ejb remains the same object per servlet lifetime or it works as a service locator every time servlet wants something from ejb?
2. What if the injected ejb should be destroyed because of some exception - container injects new ejb automatically?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic