Play framework 2.1.0
使用MSSQL
数据库
申请表:
db.default.url="jdbc:jtds:sqlserver://localhost:1433/PlayApp;instance=SQL2008"
db.default.driver=net.sourceforge.jtds.jdbc.Driver
db.default.user=sa
db.default.pass=test
db.default.partitionCount=1
db.default.maxConnectionsPerPartition=5
db.default.minConnectionsPerPartition=5
db.default.acquireIncrement=1
db.default.acquireRetryAttempts=1
db.default.acquireRetryDelay=5
以下例外:
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - Listening for HTTP on /0.0.0.0:9000
(Server started, use Ctrl+D to stop and go back to the console...)
[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 5ms and trying again. Attempts left: 1. Exception: null
[error] application -
! @6h0j5mlj9 - Internal server error, for (GET) [/] ->
play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configuration.scala:80) ~[play_2.10.jar:2.1.0]
at play.api.Configuration.reportError(Configuration.scala:558) ~[play_2.10.jar:2.1.0]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:251) ~[play-jdbc_2.10.jar:2.1.0]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:242) ~[play-jdbc_2.10.jar:2.1.0]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library.jar:na]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) ~[scala-library.jar:na]
[error] application -
我试图对问题进行排序,但我每次遇到此错误都需要重新启动我的Sql实例是否存在连接池问题?
任何一个人都能回答?
答案 0 :(得分:1)
你可以尝试改变
db.default.acquireRetryDelay=5
通过
db.default.acquireRetryDelay=5 seconds