Copy GardenWorld into a new Client using Copy Client - failing in oracle and postgresql native

Description

https://docs.google.com/document/d/1nab3y2ILY75_DJ_7_sI116mNgMoZvPFqltT9zEsIDZU/edit?ts=5fb44cfa#heading=h.rx8rhaqmmjx3

Test Steps
Login Data
User = SuperUser
Role = System

Steps
Open Copy Client process
Parameters
Copy Template Client = Y
Client Name = New Garden
Client Key = NewGarden
Tables to Exclude = empty
Clients to Include = 11 (this is GardenWorld AD_Client_ID)
Only Validate Data = N
Skip Some Validations = N

Test Data
The process is tested with the whole data in GardenWorld

Expected Results
New client created (in this case New Garden) with the same data as GardenWorld

Actual Results
Server: triage3.idempiere.org
This server is running with PostgreSQLNative=Y
Error ** Could not execute: INSERT INTO AD_WF_Node(AD_Client_ID,AD_Column_ID,AD_CtxHelp_ID,AD_Form_ID,AD_Image_ID,AD_InfoWindow_ID,AD_Org_ID,AD_Process_ID,AD_Task_ID,AD_WF_Block_ID,AD_WF_Node_ID,AD_WF_Node_UU,AD_WF_Responsible_ID,AD_Window_ID,AD_Workflow_ID,Action,AttributeName,AttributeValue,C_BPartner_ID,Cost,Created,CreatedBy,Description,DocAction,Duration,DynPriorityChange,DynPriorityUnit,EMail,EMailRecipient,EntityType,FinishMode,Help,IsActive,IsCentrallyMaintained,IsMilestone,IsSubcontracting,JoinElement,Limit,MovingTime,Name,OverlapUnits,Priority,QueuingTime,R_MailText_ID,S_Resource_ID,SetupTime,SplitElement,StartMode,SubflowExecution,UnitsCycles,Updated,UpdatedBy,ValidFrom,ValidTo,Value,WaitTime,WaitingTime,Workflow_ID,WorkingTime,XPosition,YPosition,Yield) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Cause = org.postgresql.util.PSQLException: ERROR: syntax error at or near "Limit" Position: 489

Server: test-oracle.idempiere.org
This server is running with Oracle
Error: ** Could not execute: INSERT INTO AD_ClientInfo(AD_ClientInfo_UU,AD_Client_ID,AD_Org_ID,AD_StorageProvider_ID,AD_Tree_Activity_ID,AD_Tree_BPartner_ID,AD_Tree_Campaign_ID,AD_Tree_Menu_ID,AD_Tree_Org_ID,AD_Tree_Product_ID,AD_Tree_Project_ID,AD_Tree_SalesRegion_ID,C_AcctSchema1_ID,C_BPartnerCashTrx_ID,C_Calendar_ID,C_ChargeFreight_ID,C_UOM_Length_ID,C_UOM_Time_ID,C_UOM_Volume_ID,C_UOM_Weight_ID,Created,CreatedBy,FY_StartDate,IsActive,IsConfirmOnDocClose,IsConfirmOnDocVoid,IsDiscountLineAmt,KeepLogDays,LogoReport_ID,LogoWeb_ID,Logo_ID,M_ProductFreight_ID,StorageArchive_ID,StorageImage_ID,Updated,UpdatedBy) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Cause = java.sql.SQLIntegrityConstraintViolationException: ORA-02291: integrity constraint (IDEMPIERE.CCALENDAR_ADCLIENTINFO) violated - parent key not found

Server: test.idempiere.org
This server is running with PostgreSQL, Oracle Dialect
Success: ** OK

Pass/Fail
Failed in oracle and postgresql native
Pass in Postgresql with oracle dialect

Environment

None

Activity

Show:

Carlos Ruiz November 21, 2020 at 12:24 AM

The pull request 399 fixes the problem in postgresql native.

The problem in oracle is more complex, it is caused because in the seed database most of the constraints are NOT defined as DEFERRABLE INITIALLY DEFERRED

This query

shows there are 594 constraints correctly defined and 2920 wrongly defined.

Because oracle doesn't have an alter to modify such constraint we would need a pl/sql script that drops the 2920 constraints and recreates them with the DEFERRABLE INITIALLY DEFERRED.

Too time consuming at this moment, I'll keep this as a known issue for oracle and wait for somebody requiring this.

Regards,

Carlos Ruiz

Fixed

Details

Assignee

Reporter

Labels

Fix versions

Priority

Created November 18, 2020 at 1:44 PM
Updated December 5, 2021 at 2:21 PM
Resolved November 21, 2020 at 9:06 AM