小编Fra*_*rds的帖子

HikariCP 连接池 - 'active' - 如何调试?

I am building an app using Spring-Boot/Hibernate with Postgres as the database. I am using Spring 2.0, so Hikari is the default connection pool provider.

Currently, I am trying to load-test the application with a REST end-point that does an 'update-if-exists and insert if new' to an entity in the database. Its a fairly small entity with 'BIGSERIAL' primary key and no constraints on any other field.

The default connection pool size is 10 and I haven't really tweaked any …

postgresql hibernate spring-boot hikaricp

9
推荐指数
1
解决办法
5788
查看次数

使用重写规则将http重定向到https时,AlwaysOn功能无法正常工作

我有一个Azure PaaS实例在Tomcat8容器中运行Spring-Boot打包的"war".问题是,经过一段时间的活动后,"java"进程被终止.

在此输入图像描述

上面的图片是tomcat进程未被杀死时的样子.

只有当我再次向服务器发出任何类型的请求时,tomcat进程才会再次启动.

如果我的理解是正确的,标志'WEBSITE_SCM_ALWAYS_ON_ENABLED'是为了让实例保持活跃,即'w3wp'进程,而不是Tomcat.

解决此问题的一个方法是使用简单的"运行状况"请求"轮询"我的服务器以使其保持活动状态.

如果它的'httpPlatformHandler'有一些Azure配置或Spring-boot配置会更好,这样我就可以防止它进入睡眠状态.

任何帮助表示赞赏.

****更新****

在@DavidEbbo的进一步帮助下,问题被追溯到我从"http"到"https"网址的URL"重写"规则."AlwaysOn"请求在HTTP(端口80)上,因此每当命中Azure请求时,它都会获得重定向(301)作为响应.仍在等待解决方案.

spring tomcat azure azure-web-sites spring-boot

5
推荐指数
1
解决办法
509
查看次数

Java8 - 按索引获取但类似于 Map 的“getOrDefault”?

是否有更简洁的方法来检查值是否存在于特定索引处,例如list.getOrDefault(index, "defaultValue"). 或者甚至在特定索引超出列表范围时执行默认操作。

执行此操作的正常方法是在尝试此操作之前检查列表的大小。

collections optional java-8

5
推荐指数
1
解决办法
3317
查看次数