Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0009287Openbravo ERPA. Platformpublic2009-06-02 12:132009-07-27 00:00
AinhoaPagola 
shuehner 
urgentminorhave not tried
closedfixed 
20Ubuntu 8.4
main 
2.50MP3 
Core
No
0009287: Errors thrown from triggers with code -20000 are not correctly displayed in Oracle
If an error message with code -20000 is thrown from a trigger in Oracle, the error message displayed in the application contains the error message and some extra unnecessary information.

Example:
      
There is already one default setup record. Only one record is allowed.
ORA-06512: en "MAINHCM.HCMC_DEFAULT_TRG", línea 35
ORA-04088: error durante la ejecución del disparador 'MAINHCM.HCMC_DEFAULT_TRG'

Notice that the first sentence is the msgtext of the error message thrown.
This only happens if the error code used is -20000, it works fine with other codes.

This problem is not visible in core because every single error thrown in a trigger has a numeric code in its message value. In modules, the value of the message must start with the prefix so it is not posible to set a number to it an skip this problem.

This problem is not reproducible in functions. The translation is properly done in that case. It is also not reproduceable in PostgreSQL, it works fine for triggers and functions.

That is, this problem happens: In oracle, for message with string value thrown in triggers.

 
- Create a message in add_message with a string value. That is, do not use a numeric value (like 20540) but a string (example "MoreThanOneRecord").
- Raise the error from a trigger. Use this instruction:
RAISE_APPLICATION_ERROR(-20000,'@HCMC_OneDefaultRecord@');
- In the application, perform the action that launches the trigger. The error displayed in the error box contains the error message properly translated and some extra error message that shouldn't be visible.
250MP3releasecandidate, Modularity
related to defect 0010180 closed shuehner Error thrwon from a function (coming from a trigger) is not properly translated in Oracle 
Issue History
2009-06-02 12:13AinhoaPagolaNew Issue
2009-06-02 12:13AinhoaPagolaAssigned To => rafaroda
2009-06-02 15:04AinhoaPagolaversion => main
2009-06-03 10:02rafarodaAssigned Torafaroda => shuehner
2009-06-03 10:02rafarodaPrioritynormal => high
2009-06-03 10:02rafarodaStatusnew => scheduled
2009-06-09 19:35AinhoaPagolaPriorityhigh => urgent
2009-06-18 10:53AinhoaPagolaTag Attached: Modularity
2009-06-18 13:22hgbotCheckin
2009-06-18 13:22hgbotNote Added: 0017424
2009-06-18 13:22hgbotStatusscheduled => resolved
2009-06-18 13:22hgbotResolutionopen => fixed
2009-06-18 13:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3e83886b79dc5a92c167dc9184a41d3b380cd94f [^]
2009-06-22 11:09psarobeFixed in Version => main
2009-07-13 11:24AinhoaPagolaNote Added: 0018157
2009-07-21 16:24psarobeFixed in Versionmain => 2.50MP3
2009-07-21 16:26psarobeTag Attached: 250MP3releasecandidate
2009-07-26 22:01psarobeStatusresolved => closed
2009-07-26 22:01psarobeNote Added: 0018620
2009-07-27 00:00anonymoussf_bug_id0 => 2827480
2009-08-04 15:22AinhoaPagolaRelationship addedrelated to 0010180

Notes
(0017424)
hgbot   
2009-06-18 13:22   
Repository: erp/devel/pi
Changeset: 3e83886b79dc5a92c167dc9184a41d3b380cd94f
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Jun 18 13:21:56 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3e83886b79dc5a92c167dc9184a41d3b380cd94f [^]

Fixed 9287. Restrict the incoming error message for code=20000 to one line
- Restrict the incoming token string which are translated for the error code 20000 to the first line
- If these are raised from inside a trigger a pl-stacktrace is attched to the incoming error string
- This change discards the extra stacktrace lines

---
M src/org/openbravo/erpCommon/utility/ErrorTextParserORACLE.java
---
(0018157)
AinhoaPagola   
2009-07-13 11:24   
I have tested the solution and works fine for me.
(0018620)
psarobe   
2009-07-26 22:01   
Thanks Ainhoa