Difference Between Session and Entity Beans

发布时间 2023-06-01 16:28:22作者: zno2

https://docs.oracle.com/cd/E17802_01/j2ee/j2ee/1.4/docs/tutorial-update6/doc/EJBConcepts4.html

 

You should probably use an entity bean under the following conditions:

  • The bean represents a business entity and not a procedure. For example, CreditCardBean would be an entity bean, but CreditCardVerifierBean would be a session bean.
  • The bean's state must be persistent. If the bean instance terminates or if the Application Server is shut down, the bean's state still exists in persistent storage (a database).