1

我正在尝试将 Teradata 与 HikariCP 集成到 Grails 应用程序中并面临问题。我可以使用默认的 Grails 连接池或数据源以相同的配置连接到 Teradata。我也尝试调整连接超时。

使用的库:

兆数据:

runtime (group: 'com.teradata', name:'terajdbc4', version:'13.10.0.8')
runtime (group: 'com.teradata', name:'tdgssconfig', version:'13.10.0.8')

HikariCp:

compile (group: 'com.zaxxer', name: 'HikariCP-java6', version: '2.2.4')

使用的连接属性:

[logSql:false, loggingSql:true, dialect:org.hibernate.dialect.TeradataDialect,
 driverClassName:com.teradata.jdbc.TeraDriver, username:userId, password:pwd,
 url:jdbc:teradata://DBName, pooled:true,
 properties:[initialSize:5, minIdle:1, maxIdle:5, maxActive:3, maxWait:2000,
             maxAge:60000, minEvictableIdleTimeMillis:30000, timeBetweenEvictionRunsMillis:30000,
             abandonWhenPercentageFull:50, numTestsPerEvictionRun:3, testOnBorrow:true,
             testWhileIdle:true, testOnReturn:true, validationQuery:SELECT 1,
             validationInterval:500], jndiName:[:], readOnly:[:], passwordEncryptionCodec:[:]]

错误日志:

TERAJDBC4 ERROR [HikariCP connection filler (pool HikariPool-0)] com.teradata.jdbc.jdbc_4.TDSession@5f045975 Connection to DBName
Tue May 05 17:20:50 CDT 2015 socket orig=DBName cid=247608ab sess=0 com.teradata.jdbc.jdbc_4.util.JDBCException:
[Teradata JDBC Driver] [TeraJDBC 13.10.00.08] [Error 1276] [SQLState 08S01] Exceeded login timeout for DBName
   at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:92)
   at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:67)
   at com.teradata.jdbc.jdbc.ConnectionBase.checkRemainingLoginTime(ConnectionBase.java:81)
   at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF$Lookup.<init>(TDNetworkIOIF.java:168)
   at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.connectToHost(TDNetworkIOIF.java:289)
   at com.teradata.jdbc.jdbc_4.io.TDNetworkIOIF.<init>(TDNetworkIOIF.java:108)
   at com.teradata.jdbc.jdbc_4.TDSession.getIO(TDSession.java:584)
   at com.teradata.jdbc.jdbc.GenericStateController.<init>(GenericStateController.java:41)
   at com.teradata.jdbc.jdbc.GenericLogonController.<init>(GenericLogonController.java:40)
   at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:202)
   at com.teradata.jdbc.jdbc_3.ifjdbc_4.TeraLocalConnection.<init>(TeraLocalConnection.java:99)
   at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:58)
   at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:218)
   at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:151)
   at java.sql.DriverManager.getConnection(DriverManager.java:571)
   at java.sql.DriverManager.getConnection(DriverManager.java:187)
   at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:56)
   at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:62)
   at com.zaxxer.hikari.pool.HikariPool.addConnection(HikariPool.java:415)
   at com.zaxxer.hikari.pool.HikariPool.access$400(HikariPool.java:73)
   at com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:316)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
   at java.util.concurrent.FutureTask.run(FutureTask.java:262)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
   at java.lang.Thread.run(Thread.java:745)
Error | 2015-05-05 17:20:51,234 [HikariCP connection filler (pool HikariPool-0)] ERROR pool.HikariPool  - JDBC4 Connection.isValid() method not supported, connection test query must be configured
Error | 2015-05-05 17:20:51,821 [HikariCP connection filler (pool HikariPool-0)] ERROR pool.HikariPool  - JDBC4 Connection.isValid() method not supported, connection test query must be configured
4

1 回答 1

0

我不确定这些是有效的连接属性还是无效的连接属性,但它们肯定不是 HikariCP 属性。我建议启用 DEBUG 级别的日志记录,然后检查HikariCP在启动时记录的属性,以确保它们符合您的期望。

于 2015-05-06T12:20:58.630 回答