Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0002553Openbravo ERP03. Procurement managementpublic2008-01-25 10:552008-07-09 09:45
egoitz 
rafaroda 
normalminoralways
closedfixed 
5
 
2.40beta 
No
Core
No
0002553: OBN: error fillign order ref. after copy lines on PO
STEPS:
Procurement Managemente>Transactions>Purchase Order

DESCRIPTION:
Enter an order and do not fill-in an order reference, copy lines for other
order and then afterwards try to fill in the order reference, we get the following error:

ORA-04091: table TAD.C_ORDER is mutating, trigger/function may not see it
ORA-06512: at "TAD.C_ORDLINE_CHK_RESTRICTIONS_TRG", line 27
ORA-04088: error during execution of trigger 'TAD.C_ORDLINE_CHK_RESTRICTIONS_TRG'
ORA-06512: at "TAD.C_ORDER_TRG", line 48 ORA-04088: error during execution of trigger
'TAD.C_ORDER_TRG'

This error is explained by the following webpage:

http://www.techonthenet.com/oracle/errors/ora04091.php [^]

The reason is that the trigger C_ORDER_TRG updates the C_ORDERLINES table which
triggers the C_ORDLINE_CHK_RESTRICTIONS_TRG trigger.
The C_ORDLINE_CHK_RESTRICTIONS_TRG trigger makes a select to the C_ORDER table which
is not allowed in this case because this table
is being updated!

ENVIROMENT:
OBN

No tags attached.
depends on backport 0003622 closed rafaroda OBN: error fillign order ref. after copy lines 
Issue History
2008-07-09 09:45plujanStatusresolved => closed
2008-07-09 09:45plujanFixed in Version2.40alpha-r2 => 2.40beta

Notes
(0006142)
user71   
2005-06-01 00:00   
(edited on: 2008-06-12 09:43)
This bug was originally reported in SourceForge bug tracker and then migrated to Mantis.

You can see the original bug report in:
https://sourceforge.net/support/tracker.php?aid=1879538 [^]
(0003091)
egoitz   
2008-01-25 10:59   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1853880
Originator: YES

File Added: error.JPG
(0003092)
egoitz   
2008-02-04 12:30   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1853880
Originator: YES

This bug should be solved in In mid-February
(0003093)
rafaroda   
2008-02-08 15:47   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1892190
Originator: NO

More simple steps to reproduce:
1. Create a new Purchase Order (Procurement Management > Transactions > Purchase Order). Save.
2. Create a new line (Procurement Management > Transactions > Purchase Order > Lines). Save.
3. Go back to Purchase Order.
4. Change Order Reference (or Description or Service Point) and try to save.
(0003094)
rafaroda   
2008-02-08 17:22   
(edited on: 2008-06-12 09:24)
Logged In: YES
user_id=1892190
Originator: NO

'C_ORDLINE_CHK_RESTRICTIONS_TRG' trigger needed an UPDATE OF clause to work correctly. UPDATE OF clauses have been deprecated since PostgreSQL do not recognize them nor DdlUtils so this trigger was failing.

A SELECT clause was made before this checking and this was leading to a mutant table error: ORA-04091

To be able to substitute UPDATE OF clause, IF clauses have been added through this trigger.