问题描述
我无法找到一种在ejb中设置TransactionIsolation的方法。有人可以告诉我如何设置?我正在使用持久性。
I am not able to find a way to set TransactionIsolation in ejb. Can anybody tell me how do i set it? I am using persistence.
我看过以下类:
EntityManager,EntityManagerFactory,UserTransaction。他们似乎都没有像SetTransactionIsolation这样的方法。我们需要更改persistence.xml吗?
I have looked the following classes :EntityManager , EntityManagerFactory, UserTransaction. None of them seems to have any method like setTransactionIsolation or such. Do we need to change persistence.xml?
我刚读了一本名为Mastering EJB 3.0第4版的书。他们给出了关于这个问题发生和发生的隔离级别的完整的10页理论,但是最后他们给出了这一段: -
I just read a book named 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 :-
"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. "
什么exactl这是不是意味着?资源级API是什么意思?请帮帮我。如果持久化没有办法设置隔离级别,那么为什么他们在EJB书中给出如此巨大的理论,并且不必要地使重量变重:(
What exactly does it mean? What is meant by resource level APIs? 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中设置事务隔离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!