有时我的 play2 应用程序可以工作,但有时不能。我怀疑它没有在开发模式下释放连接。这是错误:
[error] c.j.b.h.AbstractConnectionHook - Failed to obtain initial connection Sle
eping for 0ms and trying again. Attempts left: 0. Exception: null
[error] application -
! @6c1j5m094 - Internal server error, for request [GET /] ->
play.api.Configuration$$anon$1: Configuration error [Cannot connect to database
[default]]
at play.api.Configuration$.play$api$Configuration$$configError(Configura
tion.scala:71) ~[play_2.9.1.jar:2.0.4]
at play.api.Configuration.reportError(Configuration.scala:258) ~[play_2.
9.1.jar:2.0.4]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:249) ~[pla
y_2.9.1.jar:2.0.4]
at play.api.db.BoneCPPlugin$$anonfun$onStart$1.apply(DB.scala:240) ~[pla
y_2.9.1.jar:2.0.4]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:194) ~[scala-library.jar:0.11.3]
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike
.scala:194) ~[scala-library.jar:0.11.3]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: User bestt
v already has more than 'max_user_connections' active connections
这是我的配置(我只放了我添加的条目来解决这个问题,但似乎没有帮助):
db.default.partitionCount=1
db.default.maxConnectionsPerPartition=5
db.default.minConnectionsPerPartition=1
db.default.acquireIncrement=1
db.default.acquireRetryAttempts=1
db.default.acquireRetryDelay=5 seconds
不知道是不是跟cloudbees或者play有关。类似游戏的人说它在游戏 2 (一月)中解决了,但似乎没有..