Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Surviving a Container Crash

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

I am very confused as to how to answer the question which types of EJB can survive a Container Crash. There are contradictions in opinions even within this forum. Does anyone know what answer will be seen as correct on the exam?

So far Entity Bean seems like a certainty to survuve and Stateful Session Bean not to survive. But I've seen conflicting opinions on whether Stateless Session Beans or MDBs survive. Help!
 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Claire

Entity Beans: survive container crash because an entity bean is saved as a record in the database.

Stateless/Stateful Session Beans / Message-driven Beans: do not survive container crash.

Thanks

-- Ravi
 
Claire Simpson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for clearing that one up Ravi.
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps by understanding/knowing why does entity beans survive container crashes, you would find no confusion anywhere.

Entity beans represent an entity in the underlying store (usually a database). In the simplest example, an entity bean could be representing a single row in a table in our database.

So what if our web/application server crashes? When we get it up again, the entity bean could simple fetch the data from the database again, because, the crash of the web/application server is not tied to the database. Unless, of course, our database crashes, then the entity bean cannot get back its value (but you could backup & restore your database).

Think about session beans & MDBs. Do you store any of the state that they carry in any form of persistent storage? Nope. They're all in the heap. Memory.

HTH.
reply
    Bookmark Topic Watch Topic
  • New Topic