Persistence Unit and transaction-type

"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

猜你喜欢

转载自jsfcoder.iteye.com/blog/2148025