Enterprise Beans Note: Two different categories of Enterprise Beans are defined in EJB (Enterprise Java Beans): - session bean - Entity Bean 1. Session bean session bean is called Its client code is to be done. When the client is connected to the server, then a session bean is established. According to the status of the session bean, it is divided into: a. Status session bean (stateful session bean) b. No status session bean 1.1 status session bean (stateful session bean) When the client and server establish a connection, status Session Bean will keep a certain state of the user between the client and the server. For example: When the user uses an online shopping cart, after clicking purchase, the user can perform multiple purchase operations, in which the user's purchase status will always be retained until he finished the account, end this operation. At this time, the status session bean is destroyed. 1.2 Status Session Bean (Stateless Session Bean) When the client and server establish a connection, the stateless session bean process a single user request or business process. The stateless session bean does not need to extract any status from the previous request.
For example, the user's application is confirmed. After the user is submitted, the request is sent. Components return true or false to confirm the success, once the process is complete, the stateless session bean is also declared. 2. Entity Bean Entity Bean is just a data model, which does not include business logic. Entity Bean (Entity BEAN) can map data from the relational / object database to memory for other components. Entity Bean has been existing and has high fault tolerance. Entity Bean (Entity Bean) allows multiple users to be accessed simultaneously.
Session bean notes; EJB execution process is made in an EJB container, so the client will not call our written Enterprise Bean, but call an EJBObject generated by the EJB container (EJB object) to fulfill. So, when we write the server-end Enterprise Bean, we should consider this. Since the client cannot access directly, it is sent to EJBOBJECT, so when writing the server side, the server side is to write a server-side interface (Remote) to contact the client, instantiate EJBOBJECT. To generate EJBOBJECT, you must have a Home interface to create this instance.
Finally, if some netizens want to communicate with my technology, please send it to Wyawxj@yahoo.com.cn. I am willing to learn and discuss with you. QQ: 9339486