如何配置玻璃鱼以使用应用程序管理的实体管理器?我通过下面给出的配置得到以下错误.
我不希望glassfish管理事务,我只想在持久性单元中使用带有RESOURCE_LOCAL设置的Spring托管事务,而不是JTA
SEVERE: Exception while preparing the app : The persistence-context-ref-name [org.springframework.data.jpa.repository.support.JpaRepositoryfactorybean/entityManager] .... resolves to a persistence unit called [spring-jpa] which is of type RESOURCE_LOCAL. Only persistence units with transaction type JTA can be used as a container managed entity manager. Please verify your application.
我的配置:
MysqL/mydb
我的应用背景:
factorybean">
sql" value="true" />
MysqL" />
MysqL5Dialect"/>
最佳答案
我发现this forum post,我引用:
In a Java EE environment,if this element [transaction-type] is not
specified,the default is JTA. In a Java SE environment,if this
element is not specified,a default of RESOURCE_LOCAL may be assumed.
所以,在你的配置中尝试: