我無法找到在ejb中設置TransactionIsolation的方法。任何人都可以告訴我如何設置它?我正在使用持久性。如何在EJB中設置事務隔離?
我看了以下類: EntityManager,EntityManagerFactory,UserTransaction。他們都沒有像setTransactionIsolation或類似的方法。我們是否需要更改persistence.xml?
我剛剛讀了一本名爲Mastering EJB 3.0第4版的書。他們給了有關隔離級別了整整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的書,並使其在重量不必要:(重
喜竹, 你提到不包含READ_COMMITED或READ_UNCOMMITED或SERIALIZABLE或REPEATABLE_READ的任何名稱的頁面?這些隔離級別在您提到的頁面上?他們似乎與我在書中讀到的不同? – TCM 2010-04-15 05:24:08
這些是JDBC隔離級別。請參閱http://docs.sun.com/app/docs/doc/820-7695/beamv?a=view – 2010-04-15 05:37:44