"The transaction-type attribute is used to specify whether the entity managers provided by the entity manager factory for the persistence unit must be JTA entity managers or resource-local entity managers. The value of this element is JTA or RESOURCE_LOCAL. A transaction-type of JTA assumes that a JTA data source will be provided—either as specified by the jta-data-source element or provided by the container. In general, in Java EE environments, a transaction-type of RESOURCE_LOCAL assumes that a non-JTA datasource will be provided. In a Java EE environment, if this element is not specified, the default is JTA. In a Java SE environment, if this element is not specified, the default is RESOURCE_LOCAL." see Section 8.2.1.2, Page 312 from JSR-317
ref:http://www.adam-bien.com/roller/abien/entry/don_t_use_jpa_s
sample java app use RESOURCE_LOCAL
javaee better us: JTA, JTA either as specified by the jta-data-source element or provided by the container
本文详细解释了在使用JPA时transaction-type属性的作用,包括JTA和RESOURCE_LOCAL两种类型的含义及其在JavaEE和JavaSE环境下的应用。
1878

被折叠的 条评论
为什么被折叠?



