AechoLiu
AechoLiu

Reputation: 18368

About exceptions on Session Bean

I am reading the book. It said the Singleton session bean will never be re-created in the event of a system exception, unlike other kind of session beans. So, I have some questions.

  1. Will both of stateless and stateful session beans be re-created in the event of a system exception ?

  2. When the singleton session bean instance encounters exceptions, could it continue to work well to response other requests ?

Upvotes: 0

Views: 117

Answers (1)

Brett Kail
Brett Kail

Reputation: 33936

  1. Stateless beans are created for every method call as necessary. Stateful beans will be destroyed, and the client needs to explicitly create a new one.

  2. Yes, singleton beans are never destroyed, so the same instance will be used for subsequent method calls even when beans of another type would be destroyed.

Upvotes: 0

Related Questions