Performance - Discover of UUID column not cached in PO

Description

Testing https://idempiere.atlassian.net/browse/IDEMPIERE-4061#icft=IDEMPIERE-4061 I noticed in PO.java the following code repeated several times:

//uuid column int uuidColumnId = DB.getSQLValue(get_TrxName(), "SELECT col.AD_Column_ID FROM AD_Column col INNER JOIN AD_Table tbl ON col.AD_Table_ID = tbl.AD_Table_ID WHERE tbl.TableName=? AND col.ColumnName=?", tableName+"_Trl", PO.getUUIDColumnName(tableName+"_Trl"));

This is in insertTranslations, insert_Accounting and insert_Tree.

Visiting the database every time is expensive, this would be better refactored to discover the existence of the UUID column using cache.

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 12, 2021 at 10:07 AM
Updated October 1, 2021 at 2:46 PM
Resolved August 12, 2021 at 2:16 PM