Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039163Openbravo ERP04. Warehouse managementpublic2018-08-21 10:522019-03-28 14:55
vmromanos 
AtulOpenbravo 
normalminoralways
closedfixed 
5
 
3.0PR19Q2 
dmiguelez
Core
No
0039163: QueryTimeoutException is no longer thrown in Oracle after Hibernate 5.3 upgrade
In case of exceptions thrown by triggers in Oracle before Hibernate upgrade they were thrown as QueryTimeoutException. However after Hibernate upgrade it is used GenericJDBCException instead (exactly the same as in PostgreSQL).

In InventoryCountProcess there is a catch block that differentiate between PG and Oracle. After Hibernate upgrade there is no need to differentiate anymore, but also we need to make sure the exception message is properly thrown in both databases.

Similar use of QueryTimeoutException could be also found in
1. VariantChDescUpdateProcess.java
2. VariantAutomaticGenerationProcess
To force a trigger exception, open the M_TRANSACTION_TRG2 and throw an exception at the beginning of the trigger. Example:
RAISE_APPLICATION_ERROR(-20000, '@CannotUseGenericProduct@');

Login as Openbravo Admin
Open Physical Inventory window.
Create a header.
Create a line and select any product.
Modify the qty (for example add one unit).
Process the record.
The exception is thrown.
Verify the message is properly shown in both Oracle and PG.
Attached proposed solution
No tags attached.
related to feature request 0037064 closed caristu upgrade hibernate to 5.3.2 
related to defect 00391493.0PR18Q4 closed Triage Finance Error message thrown by Oracle trigger after Hibernate upgrade [Oracle only] 
diff pg_ora_invcount.diff (3,149) 2018-08-21 10:52
https://issues.openbravo.com/file_download.php?file_id=12063&type=bug
Issue History
2018-08-21 10:52vmromanosNew Issue
2018-08-21 10:52vmromanosAssigned To => Triage Finance
2018-08-21 10:52vmromanosFile Added: pg_ora_invcount.diff
2018-08-21 10:52vmromanosModules => Core
2018-08-21 10:52vmromanosTriggers an Emergency Pack => No
2018-08-21 10:53vmromanosRelationship addedrelated to 0037064
2018-08-21 13:11caristuRelationship addedrelated to 0039149
2018-08-21 21:05AtulOpenbravoStatusnew => scheduled
2018-08-30 20:45AtulOpenbravoDescription Updatedbug_revision_view_page.php?rev_id=17586#r17586
2018-09-04 09:00AtulOpenbravoNote Added: 0106590
2018-11-28 11:13AtulOpenbravoNote Added: 0108143
2018-11-28 11:14AtulOpenbravoNote Edited: 0108143bug_revision_view_page.php?bugnote_id=0108143#r17981
2018-11-28 11:18AtulOpenbravoNote Added: 0108144
2018-11-28 11:18AtulOpenbravoNote Edited: 0108143bug_revision_view_page.php?bugnote_id=0108143#r17982
2018-11-28 12:26AtulOpenbravoNote Edited: 0108144bug_revision_view_page.php?bugnote_id=0108144#r17984
2019-01-16 11:48hgbotCheckin
2019-01-16 11:48hgbotNote Added: 0108977
2019-01-16 11:48hgbotStatusscheduled => resolved
2019-01-16 11:48hgbotResolutionopen => fixed
2019-01-16 11:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0906b858ed6e5d80adc88c35c2148b650bbc9879 [^]
2019-01-17 09:29dmiguelezReview Assigned To => dmiguelez
2019-01-17 09:29dmiguelezNote Added: 0108988
2019-01-17 09:29dmiguelezStatusresolved => closed
2019-01-17 09:29dmiguelezFixed in Version => 3.0PR19Q2
2019-01-18 08:29dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2019-03-28 14:55hudsonbotCheckin
2019-03-28 14:55hudsonbotNote Added: 0110732

Notes
(0106590)
AtulOpenbravo   
2018-09-04 09:00   
Test Plan

- To force a trigger exception, open the M_TRANSACTION_TRG2 and throw an exception at the beginning of the trigger. Example:

  RAISE_APPLICATION_ERROR(-20000, '@CannotUseGenericProduct@');

- Login as Openbravo Admin
- Open Physical Inventory window.
- Create a header.
- Create a line and select any product.
- Modify the qty (for example add one unit).
- Process the record.
- The exception is thrown.
- Verify the message is properly shown in both Oracle and PG.
(0108143)
AtulOpenbravo   
2018-11-28 11:13   
(edited on: 2018-11-28 11:18)
Test Plan

- To force a trigger exception, open the m_product_bef_trg and throw an exception at the beginning of the trigger. Example:

RAISE EXCEPTION '%', '@20009@'; --OBTG:-20000--

- Configure workspace in eclipse and start tomcat in debug mode.
- Add breakpoint in VariantAutomaticGenerationProcess class for try catch blocks for
  i. GenericJDBCException
  ii. QueryTimeoutException
  iii. Exception
- Login as F&B International Group Admin
- Create a Product Characteristic For eg: Color
- Create two values under it. For eg: Red, Blue.
- Create a Generic Product "Shirts" under a organization.
- Run Create Variants process.
- Realize that execution on process enters the Exception catch block.

(0108144)
AtulOpenbravo   
2018-11-28 11:18   
(edited on: 2018-11-28 12:26)
Test Plan

- To force a trigger exception, open the m_product_bef_trg and throw an exception at the beginning of the trigger. Example:

RAISE EXCEPTION '%', '@20009@'; --OBTG:-20000--

- Configure workspace in eclipse and start tomcat in debug mode.
- Add breakpoint in VariantChDescUpdateProcess class for try catch blocks for
  i. GenericJDBCException
  ii. QueryTimeoutException
  iii. Exception
- Login as F&B International Group Admin
- Run Update Product Characteristics Description process.
- Select any product from the price list - Tarifa de ventas. For eg: Vino Blanca
- Realize that execution on process enters the Exception catch block.

(0108977)
hgbot   
2019-01-16 11:48   
Repository: erp/devel/pi
Changeset: 0906b858ed6e5d80adc88c35c2148b650bbc9879
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Nov 22 17:36:26 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/0906b858ed6e5d80adc88c35c2148b650bbc9879 [^]

Fixes Issue 0039163:QueryTimeoutException is no longer
thrown in Oracle after Hibernate 5.3 upgrade

** Use split to show proper message in catch block
for GenericJDBCException.
** Catch block for QueryTimeOutException not required any longer.

---
M src/org/openbravo/materialmgmt/InventoryCountProcess.java
M src/org/openbravo/materialmgmt/VariantAutomaticGenerationProcess.java
M src/org/openbravo/materialmgmt/VariantChDescUpdateProcess.java
---
(0108988)
dmiguelez   
2019-01-17 09:29   
Code Review + Testing Ok
(0110732)
hudsonbot   
2019-03-28 14:55   
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/b2fbc1588df4 [^]
Maturity status: Test