[ 
https://issues.apache.org/jira/browse/OFBIZ-5389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13816322#comment-13816322
 ] 

Christian Carlow commented on OFBIZ-5389:
-----------------------------------------

Sorry, I was mistaken in the previous post.

DocumentIndexer.getIstance actually doesn't trigger the start() function 
because the documentIndexId already exists in the documentIndexerMap.

The DocumentIndexer thread continuously executes run() checking for new 
products passed to its queue by this line in indexProduct() of 
SearchServices.java:
        indexer.queue(new ProductDocument(productId));

The prepareDocument() that is called in run() then performs findOne() on cache 
which ultimately calls:
this.putInPrimaryKeyCache(primaryKey, GenericValue.NULL_VALUE);

putInPrimaryKeyCache seems to check the datasource for the record to place in 
cache but doesn't find it because it runs before its been added to the 
datasource.

Either the thread needs to be controlled to run after the record has been 
placed in the datasource or findOne() in prepareDocument needs to be performed 
on datasource instead of cache.

Anyone have any ideas?

Anyone have any ideas?

> Error adding newly created virtual product to purchase order
> ------------------------------------------------------------
>
>                 Key: OFBIZ-5389
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5389
>             Project: OFBiz
>          Issue Type: Bug
>    Affects Versions: SVN trunk
>            Reporter: Christian Carlow
>            Assignee: Jacopo Cappellato
>         Attachments: ProductServices.java.diff
>
>
> A "Problems getting the product entity" error occurs when adding a newly 
> created "Variant Tree Generation" virtual product is added to a purchase 
> order.  
> The feature selections are not rendered because the variant products list is 
> created from cache in which the newly created product hasn't yet been added.
> Cache searches seem somewhat ubiquitous throughout the purchase orders.  Does 
> anyone know if this was intentional for some reason which would require the 
> user to clear cache before the new products register for use?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to