Changeset 30412

Show
Ignore:
Timestamp:
02/21/08 19:04:20 (9 months ago)
Author:
tdelprat
Message:

NXP-1995
NXP-2113

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.platform/branches/5.1/nuxeo-platform-search-api/src/main/java/org/nuxeo/ecm/core/search/api/client/indexing/resources/document/impl/DocumentIndexableResourceImpl.java

    r29497 r30412  
    4444/** 
    4545 * Document indexable resource implementation. 
    46  *  
     46 * 
    4747 * @see org.nuxeo.ecm.core.search.api.client.indexing.resources.document.DocumentIndexableResource 
    48  *  
     48 * 
    4949 * @author <a href="mailto:ja@nuxeo.com">Julien Anguenot</a> 
    50  *  
     50 * 
    5151 */ 
    5252public class DocumentIndexableResourceImpl extends 
     
    119119        // Life cycle 
    120120 
    121         if (dm.isLifeCycleLoaded()) { 
    122             try { 
    123                 docCurrentLifeCycle = dm.getCurrentLifeCycleState(); 
    124             } catch (ClientException e) { 
    125                 log.warn("Cannot get additionial document model properties."); 
    126             } 
    127         } else { 
    128             try { 
    129                 docCurrentLifeCycle = getCoreSession().getCurrentLifeCycleState( 
    130                         dm.getRef()); 
    131             } catch (Exception e) { 
    132                 log.warn("Cannot get life cycle ..."); 
    133             } 
    134         } 
    135  
    136         // ACP 
    137  
    138         try { 
    139             docAcp = dm.getACP(); 
    140         } catch (Exception e) { 
    141             log.error("Cannot get ACP from dm..."); 
    142         } 
    143  
    144         // XXX seems we do have a problem in async with this. 
    145         if (docAcp == null) { 
    146             log.warn("Refetching ACP from the core... Hidding something wrong core side."); 
     121 
     122        if (isBoundToIndexingThread()) 
     123        { 
     124            // don't use the dm.getClient 
     125            // 1 - session may be closed => it will create a leaked session 
     126            // 2 - sid asociated to the dm may be associated with a user with not enought rights 
     127            if (dm.isLifeCycleLoaded()) { 
     128                try { 
     129                    docCurrentLifeCycle = getCoreSession().getCurrentLifeCycleState( 
     130                            dm.getRef()); 
     131                } catch (Exception e) { 
     132                    log.warn("Cannot get life cycle ..."); 
     133                } 
     134            } 
     135 
    147136            try { 
    148137                docAcp = getCoreSession().getACP(dm.getRef()); 
     
    151140            } 
    152141        } 
     142        else 
     143        { 
     144            if (dm.isLifeCycleLoaded()) { 
     145                try { 
     146                    docCurrentLifeCycle = dm.getCurrentLifeCycleState(); 
     147                } catch (ClientException e) { 
     148                    log.warn("Cannot get additionial document model properties."); 
     149                } 
     150            } 
     151            docAcp = dm.getACP(); 
     152        } 
     153 
     154 
     155 
    153156 
    154157        // FACETS