1

We have this object from which we are fetching our queryEvaluator

object MyDataSource {
    val queryFactory = new SqlQueryFactory
    val apachePoolingDatabaseFactory = new ApachePoolingDatabaseFactory(
    "SELECT 1",
    10,
    10,
    new Duration(1000),
    new Duration(10),
    true,
    new Duration(30000))
    val queryEvaluatorFactory = new StandardQueryEvaluatorFactory(apachePoolingDatabaseFactory, queryFactory)
    val queryEvaluator = queryEvaluatorFactory(dbConfig.driverClassName, dbConfig.url, dbConfig.username, dbConfig.password)
}

We are not explicitly closing connections, assuming that it is handled. We seem to be running out of connections on our MySQL db.

We are using the following dependencies

libraryDependencies += "com.twitter" % "querulous" % "1.2.0-generic"

libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.12"
om-nom-nom
  • 62,329
  • 13
  • 183
  • 228

0 Answers0