• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic