Plot-System
Plot-System copied to clipboard
[Bug] - Allow setting Hikari Connection options - maxLifeTime Bug
Description
Steps to Reproduce
- Use a Database server which closes connection after a short time
- Let the Plugin run idle
- Do smt like creating a plot
Possible Solution
You can configure maxLifetime in the config and find the sweatspot for your server/database.
[13:41:10] [Craft Scheduler Thread - 11 - Plot-System/WARN]: [com.zaxxer.hikari.pool.PoolBase] HikariPool-2 - Failed to validate connection org.mariadb.jdbc.MariaDbConnection@703a5aac ((conn=173157) Connection.setNetworkTimeout cannot be called on a closed connection). Possibly consider using a shorter maxLifetime value.
Related Code: https://github.com/AlpsBTE/Plot-System/blob/5e0ecacfcc41e4f0bb42c656736bb2d21a2c6912/src/main/java/com/alpsbte/plotsystem/core/database/DatabaseConnection.java#L54-L75
It also needs to be adjusted in other plugins where we use Hikari.