OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Rev 177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 291... Line 291...
291
        panelFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
291
        panelFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
292
        return panelFrame;
292
        return panelFrame;
293
    }
293
    }
294
 
294
 
295
    static public void initCache(final ComptaPropsConfiguration comptaConf) {
295
    static public void initCache(final ComptaPropsConfiguration comptaConf) {
-
 
296
        initCache(comptaConf, 600);
-
 
297
    }
-
 
298
 
-
 
299
    static public void initCache(final ComptaPropsConfiguration comptaConf, final int timeout) {
-
 
300
 
296
        final SQLBase baseSociete = comptaConf.getSQLBaseSociete();
301
        final SQLBase baseSociete = comptaConf.getSQLBaseSociete();
297
        Thread t = new Thread() {
302
        Thread t = new Thread() {
298
            @Override
303
            @Override
299
            public void run() {
304
            public void run() {
300
                // laisse le temps au logiciel de demarrer
305
                // laisse le temps au logiciel de demarrer
301
                try {
306
                try {
302
                    Thread.sleep(1000);
307
                    Thread.sleep(10000);
303
                } catch (InterruptedException e) {
308
                } catch (InterruptedException e) {
304
                    e.printStackTrace();
309
                    e.printStackTrace();
305
                }
310
                }
306
                ClasseCompte.loadClasseCompte();
311
                ClasseCompte.loadClasseCompte();
307
                CaisseCotisationSQLElement.getCaisseCotisation();
312
                CaisseCotisationSQLElement.getCaisseCotisation();
308
 
313
 
309
                SQLPreferences prefs = SQLPreferences.getMemCached(comptaConf.getRootSociete());
314
                SQLPreferences prefs = SQLPreferences.getMemCached(comptaConf.getRootSociete());
310
 
315
 
311
                Ville.init(new NXDatabaseAccessor(comptaConf), prefs.getBoolean(GestionClientPreferencePanel.LOAD_CITIES, true));
316
                Ville.init(new NXDatabaseAccessor(comptaConf), prefs.getBoolean(GestionClientPreferencePanel.LOAD_CITIES, true));
312
 
317
 
313
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("TAXE"), 600);
318
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("TAXE"), timeout);
314
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("ETAT_DEVIS"), 600);
319
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("ETAT_DEVIS"), timeout);
315
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("PREFS_COMPTE"), 600);
320
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("PREFS_COMPTE"), timeout);
316
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("COMPTE_PCE"), 600);
321
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("COMPTE_PCE"), timeout);
317
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("JOURNAL"), 600);
322
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("JOURNAL"), timeout);
318
 
323
 
319
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("COMMERCIAL"), 600);
324
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("COMMERCIAL"), timeout);
320
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("PERIODE_VALIDITE"), 1000);
325
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("PERIODE_VALIDITE"), timeout);
321
 
326
 
322
                if (comptaConf.getRootSociete().contains("DEPOT_STOCK")) {
327
                if (comptaConf.getRootSociete().contains("DEPOT_STOCK")) {
323
                    SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("DEPOT_STOCK"), 600);
328
                    SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("DEPOT_STOCK"), timeout);
324
                }
329
                }
325
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("TYPE_REGLEMENT"), 1000);
330
                SQLBackgroundTableCache.getInstance().add(baseSociete.getTable("TYPE_REGLEMENT"), timeout);
326
                SQLBackgroundTableCache.getInstance().startCacheWatcher();
331
                SQLBackgroundTableCache.getInstance().startCacheWatcher();
327
 
332
 
328
                TaxeCache.getCache();
333
                TaxeCache.getCache();
329
 
334
 
330
                final UndefinedRowValuesCache undefCache = UndefinedRowValuesCache.getInstance();
335
                final UndefinedRowValuesCache undefCache = UndefinedRowValuesCache.getInstance();