【发布时间】:2018-09-05 01:00:21
【问题描述】:
我在 heroku 上有一个使用 play-slick 连接到 postgres 实例的播放应用程序。大约 30% 的情况下,当我部署一个新应用程序时,我会在日志中看到:
java.sql.SQLTransientConnectionException: db - Connection is not available, request timed out after 1007ms.
当我重新启动应用程序时,它通常会重新启动,但有时需要尝试几次。
对于我可以做些什么来调试这个有什么建议吗?
【问题讨论】:
-
Connection is not available,您的连接是如何终止的?对我来说听起来很断断续续。 -
它不会在运行过程中终止,它只是永远不会连接到新的部署。
-
可能有点晚了,但您的启动日志中是否有较早的错误提示
Default transaction isolation level detection failed. (This ResultSet is closed.)?我发现我收到了Connection is not available错误,但堆栈跟踪更往下是Caused by: java.sql.SQLException: Unsupported transaction isolation level '-1',所以我在application.conf中手动设置它(slick.dbs.default.db.isolation = "SERIALIZABLE"),它现在可以工作了。
标签: postgresql scala heroku playframework slick