2pack fails when there is foreign key constratint violation or trxn save errors instead of deferring those affected elements

Description

2pack fails when there foreign key constratint or trxn save errors instead of deferring those affected elements.
1. When there is a foreign key violation in related to a reference while importing AD_Column element. This can be solved by deferring not terminating
2.Same for fields
3.Tricky when AD_Window_ID is being imported on AD_Table whilst the window does not exist, not created by 2pack

Attached patch solves for 1&2

Environment

None

Attachments

2
  • 23 Dec 2015, 02:18 AM
  • 10 Aug 2013, 10:30 AM

Activity

Show:

Carlos Ruiz April 2, 2019 at 3:04 PM

Comments from my peer review:
_____________

About the patch IDEMPIERE-1264.patch - there is a workaround to solve the problem and is reordering the objects in the 2pack, normally the window must be exported before the table and that works.

So, error reported is probably bad organization of the 2pack.

Probably the patch works - it requires deep tests to ensure is not covering wrong cases.
_____________

About the patch FKConstraintCheckID.patch - it seems wrong
xref https://groups.google.com/d/msg/idempiere/kCcIkxZx3-A/W78kvNR1BwAJ
patch can cover dictionary errors instead of encouraging to solve.

Regards,

Carlos Ruiz

RedhuanO December 23, 2015 at 2:21 AM

I wonder if my error is due to same: "org.adempiere.exceptions.DBException: org.postgresql.util.PSQLException: ERROR: foreign key constraint "adlanguage_mmgtranslationservi" cannot be implemented
Detail: Key columns "ad_language_id" and "ad_language" are of incompatible types: numeric and character varying."
And solved it as attached FKConstraintCheckID.patch that makes sure in MColumn.java to check if the new FK constraint is of same type i.e. "_ID" primary key as AD_Language table access is not via its PK.

Anthony Sossah August 10, 2013 at 10:30 AM

Attached patch solves 1&2

Won't Fix

Assignee

Reporter

Components

Priority

Created August 10, 2013 at 10:08 AM
Updated June 1, 2019 at 10:43 AM
Resolved April 2, 2019 at 3:04 PM

Flag notifications