[英]How do i set the Transaction Isolation in EJB?
I am not able to find a way to set TransactionIsolation in ejb. 我无法找到在ejb中设置TransactionIsolation的方法。 Can anybody tell me how do i set it?
任何人都可以告诉我如何设置它? I am using persistence.
我正在使用持久性。
I have looked the following classes : EntityManager , EntityManagerFactory, UserTransaction. 我查看了以下类:EntityManager,EntityManagerFactory,UserTransaction。 None of them seems to have any method like setTransactionIsolation or such.
他们似乎都没有像setTransactionIsolation这样的方法。 Do we need to change persistence.xml?
我们需要更改persistence.xml吗?
I just read a book named Mastering EJB 3.0 4th edition. 我刚看了一本名为Mastering EJB 3.0 4th edition的书。 They gave a full 10 page theory about Isolation level that this problems occur and that occurs and such things but at the end they gave this paragraph :-
他们给出了关于隔离级别的完整的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. "
What exactly does it mean? 究竟是什么意思? What is meant by resource level APIs?
资源级API的含义是什么? Please help me.
请帮我。 If persistence has no way to set Isolation Level then why do they give such huge theory in an EJB book and make it heavy in weight unnecessarily :(
如果持久性无法设置隔离级别,那么为什么他们会在EJB书中提供如此巨大的理论并使其在重量上不必要地重:(
As said by EJB specification 正如EJB规范所说的那样
Transactions not only make completion of a unit of work atomic, but they also isolate the units of work from each other , provided that the system allows concurrent execution of multiple units of work.
事务不仅使完成一个工作单元原子, 而且它们还将工作单元彼此隔离 ,前提是系统允许并发执行多个工作单元。
I hope it can fullfil your needs 我希望它能满足你的需求
看到这个
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.