EJB ContainerServer provides services

xiaoxiao2021-03-06  108

EJB Container is an Enterprise Java Bean executive environment, which provides powerful system-level service (System-Level-Services) through EJB Server, and programmers do not need to develop and maintain the program code belonging to the system level service. Four important system services for Persistence, Security, Concurrency and Transaction. Persistence-Persistent Persistence is a service mechanism provided by EJB Container to maintain the field variables of the Entity Bean and the consistency of the table recording. Entity Bean presents table records in the database, and clients can make table record access work by accessing the Business BEAN's Business method, as a bean of CMP (Container-Managed Persistence container management persistence), EJB The persistence of the container automatically maintains the consistency of the field variable of the Entity Bean, keeping the field variable content at any time is the latest record in the table and writes the changed field variable content in the table. In EJB1.X, each CMP's Entity Bean must declare a field variable corresponding to the table field, and after the Jejb2.x version is changed to a declaration of field access methods corresponding to the table field, whether it is a field variable or Field access methods, EJB containers automatically maintain the consistency between Entity and table records. Concurrency concurrent concurrency is the case when multiple clients access the same resource at the same time. Entity bean is used to access table records in the database, and these table records are shared by other clients. They often be accessed by multiple clients in the same time. For EJB containers, ENTITY is shared objects, customers The end may access the same ENTITY BEAN, when two clients accesses the same EJB object, to ensure the correctness and validity of data access, the EJB container automatically maintains the action of the Entity Bean access table. For example, the EJB container will first suspend the execution of the CLIENTB (access to a simultaneous access to bean) when the CLIENTA is executing the bean instance of the business method. Method request. The session bean does not allow the above situation to occur in a state SESSION bean, a session bean can only serve a client request, and the EJB container will automatically reserve the information when the client and bean instance interact, therefore multiple customers The situation where the same bean instance is accessed at the same time is not. For stateless session beans, the EJB container does not configure the same bean instance to perform multiple clients, and the EJB container does not reserve information when the client and bean instance interact, all no access is the same session Bean instance problem. Transactions transactional Transactions is to include multiple database access, including in the same block, as long as there is a database accessed statement to perform failed, then the database access command that has been executed will be canceled, all of which have been changed data records Rollback to the content before the transaction.

转载请注明原文地址:https://www.9cbs.com/read-98260.html

New Post(0)