Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0026288
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformcriticalhave not tried2014-04-15 16:002014-05-07 18:11
ReporterAugustoMauchView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision426835c75f78
ProjectionnoneETAnoneTarget Version3.0PR14Q2
OSAnyDatabasePostgreSQLJava version
OS VersionDatabase version8.xAnt version
Product VersionSCM revision 
Merge Request Status
Review Assigned Topramakrishnan
OBNetwork customerNo
Web browser
ModulesCore
Support ticket
Regression levelCoding ( Testing )
Regression date2014-02-13
Regression introduced in release
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/2356d30e0be7c80bcca638071842f5e219037357 [^]
Triggers an Emergency PackNo
Summary

0026288: Initial Organization Setup process does not work using PostgreSQL 8.4

DescriptionThe 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 [^]
Steps To Reproduce- 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.
Proposed SolutionChange:

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;
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00253513.0PR14Q2 closedAtulOpenbravo Accounting Combinations should be created when new General Ledger Configuration is defined pointing an existent Account Tree 
related to defect 00260703.0PR14Q3 closedAtulOpenbravo Initial Organization Setup error under some circumstances 

-  Notes
(0066456)
alostale (viewer)
2014-04-15 16:17

In addition trigger is defined to be executed for deletion, but no actual code exists for delete.
(0066490)
hgbot (developer)
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 (viewer)
2014-04-16 13:28

Code Review + Testing - OK.
(0066942)
hudsonbot (viewer)
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

- Issue History
Date Modified Username Field Change
2014-04-15 16:00 AugustoMauch New Issue
2014-04-15 16:00 AugustoMauch Assigned To => AtulOpenbravo
2014-04-15 16:00 AugustoMauch Modules => Core
2014-04-15 16:00 AugustoMauch OBNetwork customer => No
2014-04-15 16:00 AugustoMauch Triggers an Emergency Pack => No
2014-04-15 16:02 AugustoMauch Regression level => Coding ( Testing )
2014-04-15 16:02 AugustoMauch Regression date => 2014-02-13
2014-04-15 16:02 AugustoMauch Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/2356d30e0be7c80bcca638071842f5e219037357 [^]
2014-04-15 16:02 AugustoMauch Relationship added related to 0025351
2014-04-15 16:17 alostale Note Added: 0066456
2014-04-15 18:29 AtulOpenbravo Status new => scheduled
2014-04-15 18:29 AtulOpenbravo fix_in_branch => pi
2014-04-16 10:52 caristu Relationship added has duplicate 0026070
2014-04-16 10:57 caristu Relationship deleted has duplicate 0026070
2014-04-16 10:58 caristu Relationship added related to 0026070
2014-04-16 13:13 AtulOpenbravo Review Assigned To => pramakrishnan
2014-04-16 13:13 AtulOpenbravo fix_in_branch pi =>
2014-04-16 13:15 hgbot Checkin
2014-04-16 13:15 hgbot Note Added: 0066490
2014-04-16 13:15 hgbot Status scheduled => resolved
2014-04-16 13:15 hgbot Resolution open => fixed
2014-04-16 13:15 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/426835c75f78283df0baa686728ad56939553d90 [^]
2014-04-16 13:28 pramakrishnan Note Added: 0066493
2014-04-16 13:28 pramakrishnan Status resolved => closed
2014-05-07 18:11 hudsonbot Checkin
2014-05-07 18:11 hudsonbot Note Added: 0066942


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker