java - 如何在 Exasol 上启用 JDBC 连接池?

标签 java hibernate connection-pooling exasolution

我们在 Web 应用程序中将 Hibernate 与 Exasol 结合使用。当我们将 Hibernate 的 hibernate.connection.pool_size 属性设置为大于 1 的值(或将任何 JDBC 连接池的相应属性,例如 HikariCP、c3p0 设置为大于 1 的值)时,我们得到:

java.sql.SQLException: syntax error, unexpected FOR_READ_ONLY_, expecting end_of_input or ';' [line 1, column 93] (Session: 1622929410050974585)
    at com.exasol.jdbc.ExceptionFactory.createSQLException(ExceptionFactory.java:164)
    at com.exasol.jdbc.ExceptionFactory.createSQLException(ExceptionFactory.java:21)
    at com.exasol.jdbc.AbstractEXAPreparedStatement.<init>(AbstractEXAPreparedStatement.java:62)
    at com.exasol.jdbc.AbstractEXAPreparedStatement_14.<init>(AbstractEXAPreparedStatement_14.java:14)
    at com.exasol.jdbc.EXAPreparedStatement.<init>(EXAPreparedStatement.java:12)
    at com.exasol.jdbc.DialectGeneric.createPreparedStatement(DialectGeneric.java:10)
    at com.exasol.jdbc.AbstractEXAConnection.prepareStatement(AbstractEXAConnection.java:608)
    at org.hibernate.id.enhanced.TableGenerator.prepareStatement(TableGenerator.java:618)
    at org.hibernate.id.enhanced.TableGenerator.access$200(TableGenerator.java:127)

来自Exasol's user manual ,

The Connection Pooling of the driver manager is deactivated by default. You can explicitly activate it in the configuration tool "ODBC Data Source Administrator". But please note that in that case reused connections keep their session settings which were set via SQL commands (see ALTER SESSION).

这里提到的是ODBC,而我们使用的是JDBC。所以我的问题是,如何在 Exasol 上启用 JDBC 连接池?

我们应该在 EXA_PARAMETERS View /表中添加/更新一行吗?

最佳答案

对于 JDBC,EXASOL 本身没有集成的连接池。 但我们发现以下库非常有用: http://commons.apache.org/proper/commons-dbcp/download_dbcp.cgi 例如,这也用在 JMeter 中并且工作得很好。 但是,我们没有任何将此库与 hibernate 结合使用的经验。 顺便问一下,你用过https://github.com/exasol/hibernate-exasol吗? ?

请告诉我们进展情况,我们很乐意提供帮助! (联系我们:www.exasol.com/contact)

最诚挚的问候, Exasol 团队

关于java - 如何在 Exasol 上启用 JDBC 连接池?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54241605/

相关文章:

java - 打开旅行计划实时测试

java - 异常: org. hibernate.AnnotationException : No identifier specified for entity: jpa.租户.DataSourceConfig

java - 如何在 hibernate 中使用数据库作为备份/故障转移?

java - 如何获取没有别名的hibernate生成的sql

java - 将属性文件元素显示为 json 数组

java - 对数组中两个最大的数字进行排序

java - hibernate-spatial-4.0 创建 bytea 列类型而不是几何图形

mysql - 无法在 Tomcat7 中创建资源实例

java - 如果连接被数据库关闭,我是否需要手动关闭它?

aws-lambda - AWS Lambda RDS 连接池