IARC-CSU / CanReg5

CanReg5 is a multi user, multi platform, open source tool to input, store, check and analyse cancer registry data.
http://www.iacr.com.fr/CanReg5
GNU General Public License v3.0
24 stars 13 forks source link

C211: see if a different connection can be opened for each user #110

Open infotel4iarc opened 2 years ago

infotel4iarc commented 2 years ago

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

fbinfotel commented 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

fbinfotel commented 2 years ago

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 .