2014-10-20 76 views
1

在亨利馬烏0.9使用PostgreSQL作爲數據源,我不斷收到象夫,PostgreSQL和連接池

WARN org.apache.mahout.cf.taste.impl.model.jdbc.AbstractJDBCDataModel - You are not using ConnectionPoolDataSource. Make sure your DataSource pools connections to the database itself, or database performance will be severely reduced.

警告。

確實如此 - 每個請求都會打開新的連接。

有沒有什麼辦法可以使用PGConnectionPoolDataSource作爲PostgreSQLBooleanPrefJDBCDataModel

(目前我有no constructorfor arguments n Java::OrgApacheMahoutCfTasteImplModelJdbc::PostgreSQLBooleanPrefJDBCDataModel錯誤)

回答

2

事實上,你可能並不需要一個連接池所有的,因爲正確的解決辦法是使用基於內存的ReloadFromJDBCDataModel包裝,其中,作爲邊-effect,將連接數減少到1.