Project

General

Profile

« Previous | Next » 

Revision 643e100c

Added by Andreas Müller almost 2 years ago

fix #10090 revert init strategy and catch LIE in getCollectorTitleCache()

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Team.java
29 29

  
30 30
import org.apache.logging.log4j.LogManager;
31 31
import org.apache.logging.log4j.Logger;
32
import org.hibernate.LazyInitializationException;
33 32
import org.hibernate.annotations.Cascade;
34 33
import org.hibernate.annotations.CascadeType;
35 34
import org.hibernate.annotations.ListIndexBase;
......
358 357
            try {
359 358
                //as long as team members do not inform the team about changes the cache must be created new each time
360 359
                collectorTitleCache = cacheStrategy().getCollectorTitleCache(this);
361
            } catch (LazyInitializationException e) {
362
                //for debugging #10090 only
363
                logger.error("LIE during getCollectorTitleCache");
364
                e.printStackTrace();
365
                throw e;
360
            } catch (Exception e) {
361
                //see #10090, getCollectorTitleCache is called e.g. if team is a secundum author, in this case if members are not initialized by BeanInitializer, however, jsonlib later tries to initialize the team (the exception is swallowed so it is not critical but a stacktrace is logged, which is not necessary)
362
                //see also comment on TitleAndNameCacheAutoInitializer.initialize() for TaxonBase
363
                if (logger.isDebugEnabled()){logger.debug("LIE during getCollectorTitleCache");}
364
                return collectorTitleCache;
366 365
            }
367 366
        }
368 367
        return collectorTitleCache;

Also available in: Unified diff