OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 67 Rev 144
Line 83... Line 83...
83
    public synchronized boolean isCached(SQLTable t) {
83
    public synchronized boolean isCached(SQLTable t) {
84
        return this.list.containsKey(t);
84
        return this.list.containsKey(t);
85
    }
85
    }
86
 
86
 
87
    public synchronized SQLBackgroundTableCacheItem getCacheForTable(SQLTable t) {
87
    public synchronized SQLBackgroundTableCacheItem getCacheForTable(SQLTable t) {
88
        final SQLBackgroundTableCacheItem item = this.list.get(t);
88
        SQLBackgroundTableCacheItem item = this.list.get(t);
89
        if (item != null) {
89
        if (item != null) {
90
            item.reloadFromDbIfNeeded();
90
            item.reloadFromDbIfNeeded();
-
 
91
        } else {
-
 
92
            System.err.println("SQLBackgroundTableCache.getCacheForTable() WARNING " + t.getName() + " is not registered (use add to register)");
-
 
93
            this.add(t, 0);
-
 
94
            item = this.list.get(t);
-
 
95
            item.reloadFromDbIfNeeded();
91
        }
96
        }
92
        return item;
97
        return item;
93
    }
98
    }
94
 
99
 
95
}
100
}