获取连接时服务器的连接池关闭
我们使用Spring Data Neo4J在春季启动应用程序中遇到了很多错误,这是由此错误引起的:
org.neo4j.driver.exceptions.ServiceUnavailableException: Connection pool for server server-url.example.com:xxxx is closed while acquiring a connection.
有人知道此错误来自何处吗?我们必须在数据库服务器端还是应用程序端上调整池?
我们使用的是Neo4J 4.0.11和Spring-Data-Neo4J 6.1.1(在Spring-Boot-Starter-Data-neo4J 2.5.5中)。连接是用螺栓协议进行的。
编辑:
以下是我们的配置上的其他信息:
application.yml:
server:
port: 9080
error.include-message: always
management:
endpoint:
health:
group:
readiness:
include: neo4j
liveness:
include: neo4j
logging.level:
root: WARN
org.springframework: INFO
io.package.directions: INFO
spring:
application.name: directions
cache:
cache-names: nodes, records
caffeine.spec: maximumSize=1000
config.location: classpath:/config/
profiles.active: prod
jmx.enabled: false
jackson.serialization:
FAIL_ON_EMPTY_BEANS: false
WRITE_DATES_AS_TIMESTAMPS: true
WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS: false
spring.neo4j:
uri: ${NEO4J_URL}
authentication:
username: ${NEO4J_USERNAME}
password: ${NEO4J_PASSWORD}
mail:
api: "http://${MAIL_SERVICE_HOST:mail}:${MAIL_SERVICE_PORT:9000}"
我们使用螺栓协议连接到另一个kubernetes Pod。
这是我们相当简单的交易管理BEAN:
@Configuration
@EnableTransactionManagement
public class TxConfig {
final Driver driver;
public TxConfig(Driver driver) {
this.driver = driver;
}
@Bean
public ReactiveTransactionManager reactiveTransactionManager() {
return new ReactiveNeo4jTransactionManager(driver);
}
}
We are getting a lot of errors in our Spring boot app using Spring data Neo4j, caused by this error:
org.neo4j.driver.exceptions.ServiceUnavailableException: Connection pool for server server-url.example.com:xxxx is closed while acquiring a connection.
Does anyone have an idea of where this error comes from ? Do we have to tweak the pools on the database server side or on application side ?
We are using Neo4j 4.0.11 and spring-data-neo4j 6.1.1 (in spring-boot-starter-data-neo4j 2.5.0). The connection is made with bolt protocol.
EDIT:
Here are additional infos on our configuration:
application.yml:
server:
port: 9080
error.include-message: always
management:
endpoint:
health:
group:
readiness:
include: neo4j
liveness:
include: neo4j
logging.level:
root: WARN
org.springframework: INFO
io.package.directions: INFO
spring:
application.name: directions
cache:
cache-names: nodes, records
caffeine.spec: maximumSize=1000
config.location: classpath:/config/
profiles.active: prod
jmx.enabled: false
jackson.serialization:
FAIL_ON_EMPTY_BEANS: false
WRITE_DATES_AS_TIMESTAMPS: true
WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS: false
spring.neo4j:
uri: ${NEO4J_URL}
authentication:
username: ${NEO4J_USERNAME}
password: ${NEO4J_PASSWORD}
mail:
api: "http://${MAIL_SERVICE_HOST:mail}:${MAIL_SERVICE_PORT:9000}"
We connect to another kubernetes pod using bolt protocol.
Here is our fairly simple transaction management bean:
@Configuration
@EnableTransactionManagement
public class TxConfig {
final Driver driver;
public TxConfig(Driver driver) {
this.driver = driver;
}
@Bean
public ReactiveTransactionManager reactiveTransactionManager() {
return new ReactiveNeo4jTransactionManager(driver);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论