Play Framework 2.0。升级bonecp

时间:2013-03-26 10:16:45

标签: scala playframework playframework-2.0 sbt bonecp

Scala for Play 2.0中有一个项目。我遇到了一个已知的与bonecp 0.7.1数据库连接的错误,并希望将此库升级到0.8.0版。 在文件/project/plugins.sbt中,我添加了以下内容:

resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"

libraryDependencies += "com.jolbox" % "bonecp" % "0.8.0-rc2-SNAPSHOT"

但是在编译和发布之后,我得到了一个包含了bonecp 0.7.1的存档。我该怎么做才能让Play Framework使用bonecp 0.8.0?

2 个答案:

答案 0 :(得分:7)

在Build.scala中添加appDependencies

"com.jolbox" % "bonecp" % "0.8.0-rc1",  
"org.reflections" % "reflections" % "0.9.8"

答案 1 :(得分:6)

如果是同一个错误,我们已通过在application.conf

中添加以下内容来解决此问题
# There's a bug in BoneCP 0.7.1: It doesn't actually close expired 
# connections until garbage collection, so they leak. If the application 
# is quiet, garbage collection runs may be very far out (days). We work
# around it by not expiring connections.
# See https://groups.google.com/forum/#!topic/play-framework/RM1QwOFz-2A for 
# more info

db.default.maxConnectionAge=0

为完整起见,链接:https://groups.google.com/forum/#!topic/play-framework/RM1QwOFz-2A