2013-07-19 79 views
0

我試着用BoneCP彙集Vertica的連接,但我遇到了錯誤BoneCP與Vertica的

[BoneCP-pool-watch-thread-vertica pool] ERROR com.jolbox.bonecp.PoolWatchThread - Error in trying to obtain a connection. Retrying in 7000ms 
java.sql.SQLException: [Vertica][JDBC](11760) Cannot call setReadOnly while Connection is in a transaction. 
    at com.jolbox.bonecp.ConnectionHandle.setReadOnly(ConnectionHandle.java:1279) 
    at com.jolbox.bonecp.ConnectionHandle.<init>(ConnectionHandle.java:254) 
    at com.jolbox.bonecp.ConnectionHandle.<init>(ConnectionHandle.java:185) 
    at com.jolbox.bonecp.PoolWatchThread.fillConnections(PoolWatchThread.java:114) 
    at com.jolbox.bonecp.PoolWatchThread.run(PoolWatchThread.java:81) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
    at java.lang.Thread.run(Thread.java:662) 

這是我使用

BoneCPConfig bvcp = new BoneCPConfig(); 
    Class.forName("com.vertica.jdbc.Driver"); 
    bvcp.setPoolName("vertica pool"); 
    bvcp.setDefaultReadOnly(false); 
    bvcp.setJdbcUrl("jdbc:vertica://vertica-server:5433/schema"); 
    bvcp.setUser("username"); 
    bvcp.setPassword("vertica-pwd"); 

    BoneCPDataSource bds = new BoneCPDataSource(bvcp); 

    JdbcTemplate template = new JdbcTemplate(ds); 

    List<Map<String, Object>> ret = template 
       .queryForList("select * from table1 "); 

我試圖與甲骨文和HSQL和相同的代碼的代碼它工作正常。

這與Vertica的JDBC驅動程序5.1.1和0.8.0 BoneCP-RC1

任何幫助是極大的讚賞。

回答

0

這個問題後,我顯然在5.1.1升級交易Vertica的JDBC驅動程序6.1.2

開始建立連接後立即得到解決。