This is an automated email from the git hooks/post-receive script. New change to branch feature/8383_importer_une_sauvegarde_apres_fermeture_connexion in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git at 220908b Check if the datasource is opened and try to open it if not This branch includes the following new commits: new 220908b Check if the datasource is opened and try to open it if not The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 220908b68a50aba3565cf244b7f2cb6222a20cac Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Fri Aug 5 12:27:41 2016 +0200 Check if the datasource is opened and try to open it if not refs #8383 -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/8383_importer_une_sauvegarde_apres_fermeture_connexion in repository observe. See https://gitlab.nuiton.org/codelutin/observe.git commit 220908b68a50aba3565cf244b7f2cb6222a20cac Author: Samuel Maisonneuve <maisonneuve@codelutin.com> Date: Fri Aug 5 12:27:41 2016 +0200 Check if the datasource is opened and try to open it if not refs #8383 --- .../fr/ird/observe/ui/storage/StorageUIHandler.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java index 6096c18..a218304 100644 --- a/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java +++ b/observe-application-swing/src/main/java/fr/ird/observe/ui/storage/StorageUIHandler.java @@ -361,16 +361,23 @@ public class StorageUIHandler { boolean localDbIsSane = true; if (destroyLocalBase || model.isDoBackup()) { if (localDataSource == null) { - try { - ObserveDataSourceConfigurationTopiaH2 localConfiguration = config.getDataSourceConfigurationH2(t("observe.storage.label.local")); + ObserveDataSourceConfigurationTopiaH2 localConfiguration = config.getDataSourceConfigurationH2(t("observe.storage.label.local")); - // la base ne doit pas etre mise a jour dans ce cas - localConfiguration.setCanMigrate(false); + // la base ne doit pas etre mise a jour dans ce cas + localConfiguration.setCanMigrate(false); - // on charge un storage sur la base locale - localDataSource = ObserveSwingApplicationContext.get().newDataSource(localConfiguration); + // on charge un storage sur la base locale + localDataSource = ObserveSwingApplicationContext.get().newDataSource(localConfiguration); + } + + // Let's check if the datasource is opened or not : + // we could have close the datasource through the ui + // If the datasource is closed, we try to open it + if (!localDataSource.isOpen()) { + try { localDataSource.open(); + } catch (Exception e) { // on a pas reussi à ouvrir la base locale // cela ne doit pas empécher de continuer -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm