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;
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/initializer/TitleAndNameCacheAutoInitializer.java
73 73
            }
74 74
        } else if(bean instanceof TaxonBase)  {
75 75
            if (!bean.isProtectedTitleCache()){
76
                ((TaxonBase<?>)bean).getTaggedTitle();
76
                TaxonBase<?> taxonBase = (TaxonBase<?>)bean;
77
                taxonBase.getTaggedTitle();
78
                //#10090 alternative solution for initializing sec.collectorTitleCache, but this solution initializes sec-author.teamMembers unnecessarily therefore it is not used.
79
                //if(taxonBase.getSecSource()!=null && taxonBase.getSec() != null && taxonBase.getSec().getAuthorship() != null) {
80
                //    this.initialize(taxonBase.getSec().getAuthorship());  //to initialize xxxTitleCaches of authors (authors will be tried to be initialized
81
                //}
77 82
            }
78 83
        } else if(bean instanceof Team)  {
79 84
            Team team = (Team)bean;
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/PolytomousKeyNodePortalController.java
36 36
            "otherNode",
37 37
            "taxon.name.nomenclaturalSource.citation.authorship",
38 38
            "taxon.name.nomenclaturalSource.citation.inReference.authorship",
39
            "taxon.secSource.citation.authorship",
40
            "taxon.secSource.citation.inReference.authorship",
41 39
            "subkey.$"
42 40
    });
43 41

  

Also available in: Unified diff