北邮邹华教授《分布式环境》课件chapter4_面向构件的分布计算环境.ppt

北邮邹华教授《分布式环境》课件chapter4_面向构件的分布计算环境.ppt

* EJB构件运行的环境是EJB容器。EJB容器提供一些系统服务,如事务管理,资源管理,版本控制,动态性,一致性,安全等,极大地减轻了开发难度和复杂性,使得开发者只需关注商业应用逻辑的实现。 EJB Container 在EJB 环 境 下 主 要 作 用: 1. EJB Container 负 责 提 供 协 调 管 理、 事 务 处 理 和RMI 等 功 能。 原 则 上 讲,EJB Server 和EJB Container 可 以 由 不 同 厂 商 提 供, 但 目 前,EJB Server 和 EJB Container 由 一 家 厂 商 提 供。 2. Container 建 立Context, 负 责 切 换 协 调 不 同EJB 对 象。 3. EJB Container 可 以 有 不 同 类 型, 如TP Monitor、DBMS、Web Server 等。 厂 商 宣 布 支 持EJB, 一 般 是 提 供 不 同 应 用 的Container 系 统。 * 目录服务:相当于电话本,用来查询联系人。打电话时,首先需要在电话本中找到联系人的电话号码 远程调用:相当于打电话。 目录服务为什么本身是远程接口:相当于114查号台,通过电话来访问。 容器:相当于呼叫中心。用户拨打同一个接入号码,后端有不同的接线员来服务。若没有空闲接线员,则排队。 * * * * * * Unlike a transaction on a local database, a distributed transaction involves altering data on multiple databases. Consequently, distributed transaction processing is more complicated, because Oracle must coordinate the committing or rolling back of the changes in a transaction as a self-contained unit. In other words, the entire transaction commits, or the entire transaction rolls back. Oracle ensures the integrity of data in a distributed transaction using the two-phase commit mechanism. In the prepare phase, the initiating node in the transaction asks the other participating nodes to promise to commit or roll back the transaction. During the commit phase, the initiating node asks all participating nodes to commit the transaction. If this outcome is not possible, then all nodes are asked to roll back. All participating nodes in a distributed transaction should perform the same action: they should either all commit or all perform a rollback of the transaction. Oracle automatically controls and monitors the commit or rollback of a distributed transaction and maintains the integrity of the global database (the collection of databases participating in the transaction) using the two-phase commit mechanism. This mechanism is completely transparent, requiring no programming on the part of the user or application developer. * * * * * * * * * * * * * * * * *    *    * E

文档评论(0)

1亿VIP精品文档

相关文档