Small change that can greatly reduce the amount of processing that autoCancelOrderItems does...
----------------------------------------------------------------------------------------------- Key: OFBIZ-523 URL: http://issues.apache.org/jira/browse/OFBIZ-523 Project: OFBiz (The Open for Business Project) Issue Type: Improvement Components: order Affects Versions: SVN trunk Environment: N/A Reporter: Ray Barlow Attachments: autocancelorderitems.patch This patch only changes two files: services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=all ]
Ray Barlow updated OFBIZ-523: ----------------------------- Attachment: autocancelorderitems.patch > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12455665 ]
Jacopo Cappellato commented on OFBIZ-523: ----------------------------------------- Ray, are you sure it works? I've not tested your patch but the command: Map itemsMap = UtilMisc.toMap("statusId", "ITEM_CREATED", "statusId", "ITEM_APPROVED"); orderItems = orderHeader.getRelated("OrderItem", itemsMap, null); is translated to the sql equivalent of: ... where statusId = 'ITEM_CREATED' and statusId = 'ITEM_APPROVED' And so no record is selected. Am I wrong? > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12455682 ]
Ray Barlow commented on OFBIZ-523: ---------------------------------- OK I see what you are saying. I did test it with extra trace logging added to see what line items were being checked and it was still checking items to cancel, but I will have another look. > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=all ]
Ray Barlow updated OFBIZ-523: ----------------------------- Attachment: autocancelorderitems_v2.patch Jacopo, Thanks for the review and here is a replacement patch that addresses your comments, strange it wasn't failing completely when testing but could be Derby. It now uses a more selective findByAnd method which has the advantage of reducing the SQL results even further prior to the final date tests. I've been through and retested with an order that has approved and created line items with several scenarios for the values of autoCancelDate, autoCancelDate etc Ray > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems.patch, autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=all ]
Jacques Le Roux updated OFBIZ-523: ---------------------------------- Attachment: (was: autocancelorderitems.patch) > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12457075 ]
Jacopo Cappellato commented on OFBIZ-523: ----------------------------------------- I like this patch and I think we should commit it but since I don't know exactly how this service is supposed to work, I'd like to get the feedback from others before committing it. > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12457077 ]
Jacques Le Roux commented on OFBIZ-523: --------------------------------------- I reviewed this patch and I vote for. I did not try it but the code is quite clear and easy to review. > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12457078 ]
Jacques Le Roux commented on OFBIZ-523: --------------------------------------- Jacopo, I did not see your comment while reviewing the patch. For me it's pretty clear. This service is called by a job scheduled to run automatically every night at 01PM (Max retries: -1). You may verify this in Jobs list If you are OK I'm ready to commit it. > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12457148 ]
Jacques Le Roux commented on OFBIZ-523: --------------------------------------- Ray, Jacoo, I finally commited it in revision: 485087. Thanks > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=comments#action_12457166 ]
Jacques Le Roux commented on OFBIZ-523: --------------------------------------- Jacopo, sorry for typo on your first name ;o) > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=all ]
Jacopo Cappellato reassigned OFBIZ-523: --------------------------------------- Assignee: Jacques Le Roux > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Assigned To: Jacques Le Roux > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ http://issues.apache.org/jira/browse/OFBIZ-523?page=all ]
Jacopo Cappellato closed OFBIZ-523. ----------------------------------- Resolution: Fixed > Small change that can greatly reduce the amount of processing that autoCancelOrderItems does... > ----------------------------------------------------------------------------------------------- > > Key: OFBIZ-523 > URL: http://issues.apache.org/jira/browse/OFBIZ-523 > Project: OFBiz (The Open for Business Project) > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk > Environment: N/A > Reporter: Ray Barlow > Assigned To: Jacques Le Roux > Attachments: autocancelorderitems_v2.patch > > > This patch only changes two files: > services.xml - I've just re-written the comment based on reading and understanding the code in the method. Hopefully people will find this clearer and more precise about how it functions in different ways for orders at the CREATED and APPROVED status. > OrderServices.java - This is the real perfomance change, I've just inserted a Map filter so the sales order items code block will only check for cancel dates against line items that have a CREATED or APPROVED status. It only wastes time and resource to check COMPLETED, CANCELLED and REJECTED order items. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |