Definition of stateful bean and stateless Bean

Source: Internet
Author: User

Stateful Session Bean: each user has its own unique instance,Bean maintains user information, that is, "stateful"The bean life cycle ends once the user dies (the call ends or the instance ends.That is, each user will initially get an initial Bean.

Stateless Session Bean: Once instantiated, the bean is added to the session pool, which can be shared by all users. Even if the user has been extinct, the bean life cycle may not end, and it may still exist in the session pool for other users to call.Because there is no specific user, the status of a user cannot be maintained, so it is called stateless bean.. However, the stateless Session Bean is not stateless. If it has its own attributes (variables), these variables will be affected by all users who call it, this must be noted in practical applications.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.