Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0026288Openbravo ERPA. Platformpublic2014-04-15 16:002014-05-07 18:11
AugustoMauch 
AtulOpenbravo 
immediatecriticalhave not tried
closedfixed 
5
 
3.0PR14Q2 
pramakrishnan
No
Core
Coding ( Testing )
2014-02-13
https://code.openbravo.com/erp/devel/pi/rev/2356d30e0be7c80bcca638071842f5e219037357 [^]
No
0026288: Initial Organization Setup process does not work using PostgreSQL 8.4
The Initial Organization Setup process does not work using PostgreSQL 8.4. When this process is executed having selected reference data, this error is logged:

370461 [http-8080-5] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into C_AcctSchema_Element (IsActive, Created, CreatedBy, Updated, AD_Org_ID, UpdatedBy, C_AcctSchema_ID, ElementType, Name, SeqNo, C_Element_ID, AD_Client_ID, IsMandatory, IsBalanced, C_AcctSchema_Element_ID) values ('Y', '2014-04-15 15:41:34.199000 +02:00:00', '100', '2014-04-15 15:41:34.199000 +02:00:00', '36504E212B274E558095970C3CA76591', '100', '19A0E2076C0E451AA242253D842DBB0D', 'AC', 'Account', '20', '4A424A4A8E8D4019A60A329A6F05DC97', '23C59575B9CF467C9620760EB255B389', 'Y', 'N', '3C8AC746E1AF40F1839F66E79EC20A91') was aborted. Call getNextException to see the cause.
370462 [http-8080-5] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: record "old" is not assigned yet
  Detail: The tuple structure of a not-yet-assigned record is indeterminate.
  Where: PL/pgSQL function "c_acctschema_element_trg" line 47 at IF
370462 [http-8080-5] ERROR org.openbravo.erpCommon.businessUtility.COAUtility - insertAccountingSchema() - Error while creating accounting schema element (general ledger element) for account
370463 [http-8080-5] ERROR org.openbravo.erpCommon.businessUtility.COAUtility - Exception
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:268)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:205)
    at org.openbravo.erpCommon.businessUtility.InitialSetupUtility.insertAcctSchemaElement(InitialSetupUtility.java:1135)
    at org.openbravo.erpCommon.businessUtility.COAUtility.insertAccountingSchema(COAUtility.java:310)
    at org.openbravo.erpCommon.businessUtility.COAUtility.createAccounting(COAUtility.java:156)
    at org.openbravo.erpCommon.businessUtility.InitialOrgSetup.createAccounting(InitialOrgSetup.java:526)
    at org.openbravo.erpCommon.businessUtility.InitialOrgSetup.createOrganization(InitialOrgSetup.java:206)
    at org.openbravo.erpCommon.ad_forms.InitialOrgSetup.doPost(InitialOrgSetup.java:74)

This happens because of this line in the c_acctschema_element_trg trigger function:

IF(TG_OP = 'UPDATE' AND COALESCE(NEW.C_Element_ID,'0') <> COALESCE(OLD.C_Element_ID,'0')) THEN

PostgreSQL 8.4 does not use Short-circuit evaluation [1], so the OLD record is accessed even when the operation is 'INSERT'.

[1] http://en.wikipedia.org/wiki/Short-circuit_evaluation [^]
- Open the Initial Organization Setup process
- Fill in the mandatory fields
- Select a reference data
- Execute the process
- The process will fail and the error will be logged.
Change:

IF(TG_OP = 'INSERT') THEN
  v_CreateCombination:=TRUE;
END IF;
IF(TG_OP = 'UPDATE' AND COALESCE(NEW.C_Element_ID,'0') <> COALESCE(OLD.C_Element_ID,'0')) THEN
  v_CreateCombination:=TRUE;
END IF;

With:

IF(TG_OP = 'INSERT') THEN
  v_CreateCombination:=TRUE;
ELSIF(TG_OP = 'UPDATE' AND COALESCE(NEW.C_Element_ID,'0') <> COALESCE(OLD.C_Element_ID,'0')) THEN
  v_CreateCombination:=TRUE;
END IF;
No tags attached.
related to defect 00253513.0PR14Q2 closed AtulOpenbravo Accounting Combinations should be created when new General Ledger Configuration is defined pointing an existent Account Tree 
related to defect 00260703.0PR14Q3 closed AtulOpenbravo Initial Organization Setup error under some circumstances 
Issue History
2014-04-15 16:00AugustoMauchNew Issue
2014-04-15 16:00AugustoMauchAssigned To => AtulOpenbravo
2014-04-15 16:00AugustoMauchModules => Core
2014-04-15 16:00AugustoMauchOBNetwork customer => No
2014-04-15 16:00AugustoMauchTriggers an Emergency Pack => No
2014-04-15 16:02AugustoMauchRegression level => Coding ( Testing )
2014-04-15 16:02AugustoMauchRegression date => 2014-02-13
2014-04-15 16:02AugustoMauchRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/2356d30e0be7c80bcca638071842f5e219037357 [^]
2014-04-15 16:02AugustoMauchRelationship addedrelated to 0025351
2014-04-15 16:17alostaleNote Added: 0066456
2014-04-15 18:29AtulOpenbravoStatusnew => scheduled
2014-04-15 18:29AtulOpenbravofix_in_branch => pi
2014-04-16 10:52caristuRelationship addedhas duplicate 0026070
2014-04-16 10:57caristuRelationship deletedhas duplicate 0026070
2014-04-16 10:58caristuRelationship addedrelated to 0026070
2014-04-16 13:13AtulOpenbravoReview Assigned To => pramakrishnan
2014-04-16 13:13AtulOpenbravofix_in_branchpi =>
2014-04-16 13:15hgbotCheckin
2014-04-16 13:15hgbotNote Added: 0066490
2014-04-16 13:15hgbotStatusscheduled => resolved
2014-04-16 13:15hgbotResolutionopen => fixed
2014-04-16 13:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/426835c75f78283df0baa686728ad56939553d90 [^]
2014-04-16 13:28pramakrishnanNote Added: 0066493
2014-04-16 13:28pramakrishnanStatusresolved => closed
2014-05-07 18:11hudsonbotCheckin
2014-05-07 18:11hudsonbotNote Added: 0066942

Notes
(0066456)
alostale   
2014-04-15 16:17   
In addition trigger is defined to be executed for deletion, but no actual code exists for delete.
(0066490)
hgbot   
2014-04-16 13:15   
Repository: erp/devel/pi
Changeset: 426835c75f78283df0baa686728ad56939553d90
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Apr 16 14:54:15 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/426835c75f78283df0baa686728ad56939553d90 [^]

Fixes Issue 26288, Fixes Issue 26070: Initial Organization Setup process failed

---
M src-db/database/model/triggers/C_ACCTSCHEMA_ELEMENT_TRG.xml
---
(0066493)
pramakrishnan   
2014-04-16 13:28   
Code Review + Testing - OK.
(0066942)
hudsonbot   
2014-05-07 18:11   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/02ca2648bcdc [^]
Maturity status: Test