You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2015/03/18 12:01:25 UTC

svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Author: deepak
Date: Wed Mar 18 11:01:25 2015
New Revision: 1667495

URL: http://svn.apache.org/r1667495
Log:
Fixed OrderItemBilling cache warning, never-cache is set to true for OrderItemBilling, hence it will never put in cache. Set cache false while fetching the order item billing record in OrderReadHelper.getOrderPaymentReceivedTotalByType method.

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1667495&r1=1667494&r2=1667495&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Wed Mar 18 11:01:25 2015
@@ -1068,7 +1068,7 @@ public class OrderReadHelper {
 
         try {
             // get a set of invoice IDs that belong to the order
-            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, true);
+            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, false);
             Set<String> invoiceIds = new HashSet<String>();
             for (GenericValue orderItemBilling : orderItemBillings) {
                 invoiceIds.add(orderItemBilling.getString("invoiceId"));



Re: svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Posted by Pierre Smits <pi...@gmail.com>.
If contributors do not understand such features, maybe some additional
explanation in our wiki (or hints thereto) are in order.

Best regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

On Wed, Mar 18, 2015 at 12:28 PM, Adrian Crum <
adrian.crum@sandglass-software.com> wrote:

> No. The attribute is in the entity definition, so it is a global setting.
>
> The problem here is contributors do not understand the entity caching
> feature, and we end up with conflicting settings, or settings that don't
> make any sense.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 3/18/2015 11:20 AM, Pierre Smits wrote:
>
>> Should this not be configurable per tenant?
>>
>> Pierre Smits
>>
>> *ORRTIZ.COM <http://www.orrtiz.com>*
>>
>> Services & Solutions for Cloud-
>> Based Manufacturing, Professional
>> Services and Retail & Trade
>> http://www.orrtiz.com
>>
>> On Wed, Mar 18, 2015 at 12:04 PM, Adrian Crum <
>> adrian.crum@sandglass-software.com> wrote:
>>
>>  What about when I decide to set never-cache to false on my local copy?
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>>
>>> On 3/18/2015 11:01 AM, deepak@apache.org wrote:
>>>
>>>  Author: deepak
>>>> Date: Wed Mar 18 11:01:25 2015
>>>> New Revision: 1667495
>>>>
>>>> URL: http://svn.apache.org/r1667495
>>>> Log:
>>>> Fixed OrderItemBilling cache warning, never-cache is set to true for
>>>> OrderItemBilling, hence it will never put in cache. Set cache false
>>>> while
>>>> fetching the order item billing record in OrderReadHelper.
>>>> getOrderPaymentReceivedTotalByType method.
>>>>
>>>> Modified:
>>>>       ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>>> order/OrderReadHelper.java
>>>>
>>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>>> order/OrderReadHelper.java
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/
>>>> order/src/org/ofbiz/order/order/OrderReadHelper.java?
>>>> rev=1667495&r1=1667494&r2=1667495&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>>> order/OrderReadHelper.java
>>>> (original)
>>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>>> order/OrderReadHelper.java
>>>> Wed Mar 18 11:01:25 2015
>>>> @@ -1068,7 +1068,7 @@ public class OrderReadHelper {
>>>>
>>>>            try {
>>>>                // get a set of invoice IDs that belong to the order
>>>> -            List<GenericValue> orderItemBillings =
>>>> orderHeader.getRelated("OrderItemBilling", null, null, true);
>>>> +            List<GenericValue> orderItemBillings =
>>>> orderHeader.getRelated("OrderItemBilling", null, null, false);
>>>>                Set<String> invoiceIds = new HashSet<String>();
>>>>                for (GenericValue orderItemBilling : orderItemBillings) {
>>>>                    invoiceIds.add(orderItemBilling.getString("
>>>> invoiceId"));
>>>>
>>>>
>>>>
>>>>
>>

Re: svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Posted by Adrian Crum <ad...@sandglass-software.com>.
No. The attribute is in the entity definition, so it is a global setting.

The problem here is contributors do not understand the entity caching 
feature, and we end up with conflicting settings, or settings that don't 
make any sense.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 3/18/2015 11:20 AM, Pierre Smits wrote:
> Should this not be configurable per tenant?
>
> Pierre Smits
>
> *ORRTIZ.COM <http://www.orrtiz.com>*
> Services & Solutions for Cloud-
> Based Manufacturing, Professional
> Services and Retail & Trade
> http://www.orrtiz.com
>
> On Wed, Mar 18, 2015 at 12:04 PM, Adrian Crum <
> adrian.crum@sandglass-software.com> wrote:
>
>> What about when I decide to set never-cache to false on my local copy?
>>
>> Adrian Crum
>> Sandglass Software
>> www.sandglass-software.com
>>
>>
>> On 3/18/2015 11:01 AM, deepak@apache.org wrote:
>>
>>> Author: deepak
>>> Date: Wed Mar 18 11:01:25 2015
>>> New Revision: 1667495
>>>
>>> URL: http://svn.apache.org/r1667495
>>> Log:
>>> Fixed OrderItemBilling cache warning, never-cache is set to true for
>>> OrderItemBilling, hence it will never put in cache. Set cache false while
>>> fetching the order item billing record in OrderReadHelper.
>>> getOrderPaymentReceivedTotalByType method.
>>>
>>> Modified:
>>>       ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>> order/OrderReadHelper.java
>>>
>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/
>>> order/OrderReadHelper.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/
>>> order/src/org/ofbiz/order/order/OrderReadHelper.java?
>>> rev=1667495&r1=1667494&r2=1667495&view=diff
>>> ============================================================
>>> ==================
>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>>> (original)
>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>>> Wed Mar 18 11:01:25 2015
>>> @@ -1068,7 +1068,7 @@ public class OrderReadHelper {
>>>
>>>            try {
>>>                // get a set of invoice IDs that belong to the order
>>> -            List<GenericValue> orderItemBillings =
>>> orderHeader.getRelated("OrderItemBilling", null, null, true);
>>> +            List<GenericValue> orderItemBillings =
>>> orderHeader.getRelated("OrderItemBilling", null, null, false);
>>>                Set<String> invoiceIds = new HashSet<String>();
>>>                for (GenericValue orderItemBilling : orderItemBillings) {
>>>                    invoiceIds.add(orderItemBilling.getString("
>>> invoiceId"));
>>>
>>>
>>>
>

Re: svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Posted by Pierre Smits <pi...@gmail.com>.
Should this not be configurable per tenant?

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com

On Wed, Mar 18, 2015 at 12:04 PM, Adrian Crum <
adrian.crum@sandglass-software.com> wrote:

> What about when I decide to set never-cache to false on my local copy?
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
>
> On 3/18/2015 11:01 AM, deepak@apache.org wrote:
>
>> Author: deepak
>> Date: Wed Mar 18 11:01:25 2015
>> New Revision: 1667495
>>
>> URL: http://svn.apache.org/r1667495
>> Log:
>> Fixed OrderItemBilling cache warning, never-cache is set to true for
>> OrderItemBilling, hence it will never put in cache. Set cache false while
>> fetching the order item billing record in OrderReadHelper.
>> getOrderPaymentReceivedTotalByType method.
>>
>> Modified:
>>      ofbiz/trunk/applications/order/src/org/ofbiz/order/
>> order/OrderReadHelper.java
>>
>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/
>> order/OrderReadHelper.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/
>> order/src/org/ofbiz/order/order/OrderReadHelper.java?
>> rev=1667495&r1=1667494&r2=1667495&view=diff
>> ============================================================
>> ==================
>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>> (original)
>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>> Wed Mar 18 11:01:25 2015
>> @@ -1068,7 +1068,7 @@ public class OrderReadHelper {
>>
>>           try {
>>               // get a set of invoice IDs that belong to the order
>> -            List<GenericValue> orderItemBillings =
>> orderHeader.getRelated("OrderItemBilling", null, null, true);
>> +            List<GenericValue> orderItemBillings =
>> orderHeader.getRelated("OrderItemBilling", null, null, false);
>>               Set<String> invoiceIds = new HashSet<String>();
>>               for (GenericValue orderItemBilling : orderItemBillings) {
>>                   invoiceIds.add(orderItemBilling.getString("
>> invoiceId"));
>>
>>
>>

Re: svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Posted by Deepak Dixit <de...@hotwaxsystems.com>.
Thanks Adrian for code review, I found warning on console, and found that in all places “OrderItemBilling” record was fetched with cache=false,
if we want to override the OOTB behavior then we have to override the fetching logic as well.
I found interesting thread: http://markmail.org/message/oqfzhzypsuteqawp

Thanks & Regards
—
Deepak Dixit

> On Mar 18, 2015, at 4:34 PM, Adrian Crum <ad...@sandglass-software.com> wrote:
> 
> What about when I decide to set never-cache to false on my local copy?
> 
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
> 
> On 3/18/2015 11:01 AM, deepak@apache.org wrote:
>> Author: deepak
>> Date: Wed Mar 18 11:01:25 2015
>> New Revision: 1667495
>> 
>> URL: http://svn.apache.org/r1667495
>> Log:
>> Fixed OrderItemBilling cache warning, never-cache is set to true for OrderItemBilling, hence it will never put in cache. Set cache false while fetching the order item billing record in OrderReadHelper.getOrderPaymentReceivedTotalByType method.
>> 
>> Modified:
>>     ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>> 
>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1667495&r1=1667494&r2=1667495&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Wed Mar 18 11:01:25 2015
>> @@ -1068,7 +1068,7 @@ public class OrderReadHelper {
>> 
>>          try {
>>              // get a set of invoice IDs that belong to the order
>> -            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, true);
>> +            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, false);
>>              Set<String> invoiceIds = new HashSet<String>();
>>              for (GenericValue orderItemBilling : orderItemBillings) {
>>                  invoiceIds.add(orderItemBilling.getString("invoiceId"));
>> 
>> 


Re: svn commit: r1667495 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Posted by Adrian Crum <ad...@sandglass-software.com>.
What about when I decide to set never-cache to false on my local copy?

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 3/18/2015 11:01 AM, deepak@apache.org wrote:
> Author: deepak
> Date: Wed Mar 18 11:01:25 2015
> New Revision: 1667495
>
> URL: http://svn.apache.org/r1667495
> Log:
> Fixed OrderItemBilling cache warning, never-cache is set to true for OrderItemBilling, hence it will never put in cache. Set cache false while fetching the order item billing record in OrderReadHelper.getOrderPaymentReceivedTotalByType method.
>
> Modified:
>      ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
>
> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1667495&r1=1667494&r2=1667495&view=diff
> ==============================================================================
> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Wed Mar 18 11:01:25 2015
> @@ -1068,7 +1068,7 @@ public class OrderReadHelper {
>
>           try {
>               // get a set of invoice IDs that belong to the order
> -            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, true);
> +            List<GenericValue> orderItemBillings = orderHeader.getRelated("OrderItemBilling", null, null, false);
>               Set<String> invoiceIds = new HashSet<String>();
>               for (GenericValue orderItemBilling : orderItemBillings) {
>                   invoiceIds.add(orderItemBilling.getString("invoiceId"));
>
>