我正在使用 Hibernate 4.1.6Final 来访问 JPA 数据源。通过 c3p0 添加连接池时,我遇到了以下日志消息:
611 [main] WARN org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator - HHH000208: org.hibernate.connection.C3P0ConnectionProvider has been deprecated in favor of org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider; that provider will be used instead.
以下是我的 POM 中的休眠工件:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.6.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>4.1.6.Final</version>
</dependency>
以及来自的相关属性persistence.xml
:
<property name="hibernate.connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />
<property name="hibernate.c3p0.max_size" value="100" />
<property name="hibernate.c3p0.min_size" value="5" />
<property name="hibernate.c3p0.acquire_increment" value="5" />
<property name="hibernate.c3p0.idle_test_period" value="500" />
<property name="hibernate.c3p0.max_statements" value="50" />
<property name="hibernate.c3p0.timeout" value="10000" />
即使我将提供者的名称更改为喜欢的类,我也会收到相同的警告。使用的正确类名是hibernate.connection.provider_class
什么?是否有不是 c3p0 的用于生产用途的首选连接提供程序?