Performance: CalloutInOut for bPartner field has bad performance for BP with many locations and contacts

Description

The sql in CallOutInOut.bpartner left join c_bpartner and both c_bpartner_location and ad_user. This causes performance issue for bp with many locations and contacts.

Environment

None

Activity

Show:
Carlos Ruiz
July 26, 2020, 9:16 AM

Hi , about pull request 184:

Wouldn't be better to apply the same fix that you did for CalloutOrder in IDEMPIERE-3654, commit ad868d

I integrated the same approach in 4aac55 for CalloutInvoice, CalloutInvoiceBatch, and CalloutOrder.bPartnerBill; but I think I forgot to port it to CalloutInOut.
____________

On a different topic, I saw your change for PreparedStatement from DB.close to try-with-resources, that's a nice approach, but I think maybe I introduced a problem in our code?
I mean, the PreparedStatement.close is not equivalent to the DB.close because I'm checking there if the statement was executed in the replica and closing it accordingly, maybe that code must be moved elsewhere? Or must we avoid try-with-resources for PreparedStatement?

Regards,

Carlos Ruiz

Heng Sin Low
July 26, 2020, 10:00 AM
Edited

Hi ,

This wasn’t build by me although I did review it. Will cross check with IDEMPIERE-3654.

I’ve not follow what have been changed in DB.close but If try-with-resources doesn’t work with PrepareStatement in iDempiere, that’s a pretty strong violation of Java coding standard. I means practically, no Java Developer will expect that.

Assignee

Heng Sin Low

Reporter

Heng Sin Low

Labels

None

Tested By

None

Components

Fix versions

Priority

Major
Configure