【发布时间】:2015-12-17 23:03:47
【问题描述】:
我正在设置一个最小的工作示例,我在 Java EE (JSF) 项目中使用 EclipseLink。我的示例与以下配置和代码完美配合:
persistence.xml
<persistence
version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
>
<persistence-unit name="issat_PU_Local" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>pro.entity.Utilisateur</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/issat" />
<property name="javax.persistence.jdbc.user" value="java" />
<property name="javax.persistence.jdbc.password" value="JaVa" />
<property name="eclipselink.logging.level.sql" value="FINE" />
<property name="eclipselink.logging.parameters" value="true"/>
</properties>
</persistence-unit>
</persistence>
由于我不想使用 JTA,所以我使用 RESOURCE_LOCAL 作为事务类型,并在我的 DAO 中完全“手动”处理事务。
我现在想在我的示例中使用 BoneCP 连接池。
我应该如何精确地修改我的persistence.xml 来做到这一点?我在互联网上找到了许多使用 Hibernate 的配置示例,但我想继续使用 EclipseLink。
【问题讨论】:
标签: jpa eclipselink connection-pooling persistence.xml bonecp