Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Server Crash

 
Nesan Krish
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the server crashed or restarted, will the state of the session bean definitely lost or that depend on the server vendor? (But I guess that the HTTP Session-when using servlets- may survive after restart depend on the server vendor) Thank you.
 
Matt Lewis
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It very much depends. Typically, all state will be lost when the server crashes. It is possible to replicate session state across chosen primary and secondary nodes. In this scenario, if the server went down in the middle of an operation, that operation would be lost. This is dependent on a clustered environment in which a managed server goes down, but the other managed servers stay active.

It is also possible to use the ejbActivate and ejbPassivate methods of a stateful session bean to write session state out to persistent storage. This allows some form of recovery.

Typically, if you wish to survive a server crash, entity beans are used or a custom solution provided, as state must be written to persistent storage
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!