Project experience
First: environment
base:Spring boot and swing
Database: sqlite/mysql
Second: difficulty
- Combine spring boot and swing .
- Encounter an error when operate huge datas into sqlite thrown an exception that database is busy.
- When insert an huge datas into db , the program seems suspended
- Swing fresh issue
Third: resolve method
Q1: using the event queue SwingUtilities.invokeLater(() -> { LoginController loginController = context.getBean(LoginController.class); loginController.prepareAndOpenFrame(); });
Q2:sqlite transaction and lock is table lock; Because sqlite lock is table lock;
so, we can’t use multiple thread to save data.
We need set the connection pool’s max pool size to be 1 ,and you need close the connection resource when it has not be used
Q3:using progress bar to improve user journey
Q4: because progress runs in main thread . if you operate database in main thread. It’ll interrupt the refresh strategy