Open infotel4iarc opened 2 years ago
A pool of connection will be implemented to ensure a connection to the database per person. The framework HikariCP will be used (https://github.com/brettwooldridge/HikariCP) because it is more efficient and lightweight compare to DBCP or C3PO
The branch is https://github.com/infotel4iarc/CanReg5/tree/feature/C211
Here are the point that were done :
The way the DAO works has changed before the connection was always open and now the connection is open only during a query.
The old behaviour cause some conflict with the new one and some method like the encryptDatabase and the restoreFromBackup doesnt work properly anymore.
A rework in the DAO is needed in order to correct completely the old behavior. The method disconnects for example, should be purged and all the other call to the DAO except for the query should also be checked .
The connection to the database is initialized when starting and seems to be intended to remain alive until the server is stopped. A local run with the server started seems to show that the connection is unique. Random problems may happen when several users use the same connection. https://db.apache.org/derby/docs/10.15/devguide/cdevconcepts23499.html