Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024174Openbravo ERPA. Platformpublic2013-06-24 10:282013-07-16 14:26
jecharri 
shankarb 
urgentmajoralways
closedfixed 
5
pi 
3.0MP263.0MP25 
AugustoMauch
Google Chrome
Core
No
0024174: Little problem with Oracle messages in the ERP
Little problem with Oracle messages in the ERP

Some times oracle messages are not clear

One example
MY MESSAGE\\nORA-06512: en "TAD.C_ORDERLINE_TRG", línea 48\\nORA-04088: error durante la ejecución del disparador 'TAD.C_ORDERLINE_TRG'
-Working in Oracle, go to c_order_post and add the following line after line "Begin --BODY":
 update c_orderline set isactive = 'N' where c_order_id = v_Record_ID;

-modify c_orderline_trg with:
IF AD_isTriggerEnabled()='N' THEN RETURN;
    End If;
RAISE_APPLICATION_ERROR(-20000, 'MY MESSAGE');

-finally try to complete and order in the ERP
No tags attached.
related to defect 00242173.0MP27 closed pramakrishnan Little problem with Oracle messages in the ERP 
Issue History
2013-06-24 10:28jecharriNew Issue
2013-06-24 10:28jecharriAssigned To => AugustoMauch
2013-06-24 10:28jecharriWeb browser => Google Chrome
2013-06-24 10:28jecharriModules => Core
2013-06-24 10:28jecharriResolution time => 1374530400
2013-06-24 10:28jecharriTriggers an Emergency Pack => No
2013-06-27 05:06shankarbAssigned ToAugustoMauch => shankarb
2013-06-27 05:07shankarbReview Assigned To => AugustoMauch
2013-06-27 05:07shankarbWeb browserGoogle Chrome => Google Chrome
2013-06-27 05:07shankarbIssue Monitored: AugustoMauch
2013-06-27 05:14hgbotCheckin
2013-06-27 05:14hgbotNote Added: 0059690
2013-06-27 05:14hgbotStatusnew => resolved
2013-06-27 05:14hgbotResolutionopen => fixed
2013-06-27 05:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ac7af24d4f0baeda8fe9aa0e4284caca7460d16d [^]
2013-06-27 12:56hudsonbotCheckin
2013-06-27 12:56hudsonbotNote Added: 0059705
2013-06-27 16:18AugustoMauchRelationship addedrelated to 0024217
2013-06-27 16:56shuehnerNote Added: 0059714
2013-06-28 10:07AugustoMauchNote Added: 0059722
2013-07-01 10:12AugustoMauchNote Added: 0059789
2013-07-01 10:12AugustoMauchStatusresolved => closed
2013-07-01 10:12AugustoMauchFixed in Version => 3.0MP25
2013-07-01 10:15AugustoMauchNote Added: 0059790
2013-07-03 07:32hgbotCheckin
2013-07-03 07:32hgbotNote Added: 0059824
2013-07-03 09:09hgbotCheckin
2013-07-03 09:09hgbotNote Added: 0059825
2013-07-16 14:26hudsonbotCheckin
2013-07-16 14:26hudsonbotNote Added: 0060015
2013-07-16 14:26hudsonbotCheckin
2013-07-16 14:26hudsonbotNote Added: 0060016

Notes
(0059690)
hgbot   
2013-06-27 05:14   
Repository: erp/devel/pi
Changeset: ac7af24d4f0baeda8fe9aa0e4284caca7460d16d
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Thu Jun 27 08:40:41 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ac7af24d4f0baeda8fe9aa0e4284caca7460d16d [^]

Fixes Issue 0024174: Little problem with Oracle messages in the ERP

The first line of the oracle error stack contains meaningful error message.
Added delimiter to the indexOf method to get the first line.
Also there are unwanted backslashes because the new line is rendered as \\\n, removed them.

---
M src/org/openbravo/erpCommon/utility/ErrorTextParserORACLE.java
---
(0059705)
hudsonbot   
2013-06-27 12:56   
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/badcced5427d [^]

Maturity status: Test
(0059714)
shuehner   
2013-06-27 16:56   
That parser has more or less good testing coverage via the junit tests in the ErrorTextParserTest.java file.

I think it makes sense to add another test to this which verifies the correct behvaior.

If you check that java file you will see that it does some sql-action (i.e. insert sql causing a duplicate value for a column in a uniqe constraint).
Then the test continues to capture the sqlException to get the error message (String) thrown by the database.

Then it passes the string to the ErrorTextParser framework and compares the output (String shown to the user) with the expected value.

As the ErrorTextParser on high level just transforms String (db excpetion) to String (message for user) testing it with a junit test is quite easy.
(0059722)
AugustoMauch   
2013-06-28 10:07   
Code review done. This issue will be closed when the test is updated.
(0059789)
AugustoMauch   
2013-07-01 10:12   
Code reviewed and verified in pi@f971af045df2
(0059790)
AugustoMauch   
2013-07-01 10:15   
The updated Junit test will be included in MP26
(0059824)
hgbot   
2013-07-03 07:32   
Repository: erp/devel/pi
Changeset: ba49b0115f3390fac390da1d0b9665a6b13a9b02
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Wed Jul 03 11:02:12 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ba49b0115f3390fac390da1d0b9665a6b13a9b02 [^]

Related to Issue 24174 : Added test case for checking message parsing in Oracle.

Added test case to check that only the error message is displayed and not the whole error stack.

---
M src-test/org/openbravo/test/system/ErrorTextParserTest.java
---
(0059825)
hgbot   
2013-07-03 09:09   
Repository: erp/devel/pi
Changeset: 4db5ecf6004c8958e7bc38d510290d8a3bca3edb
Author: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
Date: Wed Jul 03 12:38:48 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/4db5ecf6004c8958e7bc38d510290d8a3bca3edb [^]

Related to Issue 24174: Backed out changeset ba49b0115f33

Backed out changeset as it fails the automated tests.

---
M src-test/org/openbravo/test/system/ErrorTextParserTest.java
---
(0060015)
hudsonbot   
2013-07-16 14:26   
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/9a5d5983399f [^]

Maturity status: Test
(0060016)
hudsonbot   
2013-07-16 14:26   
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/9a5d5983399f [^]

Maturity status: Test