【发布时间】:2015-02-12 10:36:41
【问题描述】:
我可以访问只有读取权限的远程 Oracle 数据库。 我想使用 C3P0 作为 Hibernate 的连接池。 问题是 C3P0 尝试创建一个自动测试表,但由于只读权限,它无法创建它并失败并显示
WARN [C3P0PooledConnectionPoolManager.java:944] An attempt to create an automatic test table failed. Create SQL: CREATE TABLE "c3p0_test_table" ( a CHAR(1) )
java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges
我的 C3P0 参数如下所示:
<property name="connection.provider_class">org.hibernate.c3p0.internal.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.acquire_increment">3</property>
<property name="hibernate.c3p0.idle_test_period">0</property>
<property name="hibernate.c3p0.timeout">0</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">3</property>
如何禁用自动测试表的创建?
【问题讨论】:
-
select sysdate from dual ...请添加此属性并尝试。请参考链接mchange.com/projects/c3p0/#hibernate-specific和mchange.com/projects/c3p0/#configuring_connection_testing