【发布时间】:2010-04-15 05:12:27
【问题描述】:
我无法找到在 ejb 中设置 TransactionIsolation 的方法。谁能告诉我如何设置它?我正在使用持久性。
我看过以下课程: 实体管理器,实体管理器工厂,用户事务。他们似乎都没有像 setTransactionIsolation 这样的方法。我们需要更改persistence.xml吗?
我刚刚读了一本名为 Mastering EJB 3.0 4th edition 的书。他们给出了整整 10 页的关于隔离级别的理论,即这个问题的发生和那个发生等等,但最后他们给出了这一段:-
"As we now know, the EJB standard does not deal with isolation levels directly,
and rightly so. EJB is a component specification. It defines the behavior and
contracts of a business component with clients and middleware infrastructure
(containers) such that the component can be rendered as various middleware
services properly. EJBs therefore are transactional components that interact
with resource managers, such as the JDBC resource manager or JMS resource
manager, via JTS, as part of a transaction. They are not, hence, resource
components in themselves. Since isolation levels are very specific to the
behavior and capabilities of the underlying resources, they should therefore be
specified at the resource API levels. "
具体是什么意思?资源级 API 是什么意思?请帮我。如果持久性无法设置隔离级别,那么为什么他们在 EJB 书中给出如此庞大的理论并不必要地加重它的重量:(
【问题讨论】: