gpt4 book ai didi

java - EJB限制: compromise component distributability

转载 作者:太空宇宙 更新时间:2023-11-04 08:14:04 24 4
gpt4 key购买 nike

似乎禁止从 EJB 读取文件,如此链接中所述:

http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html#file_access

Enterprise beans aren't allowed to access files primarily because files are not transactional resources. Allowing EJBs to access files or directories in the filesystem, or to use file descriptors, would compromise component distributability, and would be a security hazard.

什么是“损害组件的可分发性”???

最佳答案

摘自How to Be Distributable来自 Enterprise Servlet 和 J2EE:

An EJB may be distributed across a number of backend machines and may be moved between machines at the container's discretion. To enable this distribution model, EJB must follow a strict specification-defined ruleset for what they can and cannot do.

文件系统可能因机器而异,文件描述符肯定是不同的。使用它们可以防止 EJB 迁移和/或钝化。

另请参阅

关于java - EJB限制: compromise component distributability,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10736185/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com