kumuluz / kumuluzee

Lightweight open-source framework for developing microservices using standard Java EE technologies and migrating Java EE to cloud-native architecture.
https://ee.kumuluz.com
MIT License
291 stars 71 forks source link

Added missing validator options for connection pool #165

Closed gpor0 closed 4 years ago

gpor0 commented 4 years ago

Current implementation uses Agroal emptyValidator for validating database connections causing all connections to be always valid. Using emptyValidator results in failed sql queries when broken connections are returned from the pool. Connection may be broken due to various reasons e.g. database restart or connection loss.

This change brings use of defaultValidator which periodically checks each connection in the pool to be valid. User may configure his own sql connection validator using sql provided with configuration key: datasources[0].pool.connection-valid-sql