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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0049501
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajoralways2022-06-07 18:162022-06-08 07:11
ReportervmromanosView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0049501: Different transactional behavior in Oracle vs Postgres

DescriptionIn AD_UPDATE_PINSTANCE procedure, which is used to call some old (but very important) processes, we have this difference in code between PG and Oracle:

-- Oracle
IF (p_doCommit = 'Y') THEN
    COMMIT;
END IF;

-- Postgres
IF (p_doCommit = 'Y') THEN
    -- COMMIT;
END IF;

This change seems to be done in the DBSM directly.


This difference in the code makes that the transactional behavior between Oracle and Postgres is different, creating weird behaviors.
Steps To ReproduceThis issue can be reproduced in this automated test: org.openbravo.api.tests.importer.ImportInventory

The flow is the following:
1. We try to import a Physical Inventory trough the Openbravo API

2. As part of the import process, a preference is temporary created org.openbravo.warehouse.advancedwarehouseoperations.api.hooks.inventory.ImportInventoryOBObjectInitializer

3. Once the document is imported, the import process calls the M_INVENTORY_LISTUPDATE in org.openbravo.api.hook.inventory.ImportedInventoryBaseOBObjectAfterFlushHook

4. Then in Oracle a COMMIT is executed. In PG no COMMIT happens

5. The physical inventory is processed

6. Then the import process removes the temporal preference created before org.openbravo.warehouse.advancedwarehouseoperations.api.hooks.inventory.ImportedInventoryBaseOBObjectAfterFlushHookExtension

7. Then the automated test tries to rollback the transaction in org.openbravo.api.tests.importer.ApiImportMappingBaseTest [cleanChanges()]


In PG everything works fine and the database is not modified at all, because there is no COMMIT in the middle of the process.

However, in Oracle the preference and the physical inventory are saved in the DB because there is a COMMIT in #4
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00194383.0MP8 closedgorkaion Error messages are not properly shown in Create Standards process 

-  Notes
(0138125)
hgbot (developer)
2022-06-07 19:09

Repository: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests [^]
Changeset: 675da3e119a8cf7605cd5c5a252abba3d5a7e9ab
Author: Víctor Martínez Romanos <victor.martinez@openbravo.com>
Date: 07-06-2022 18:51:45
URL: https://gitlab.com/openbravo/ci/modules/org.openbravo.api.tests/-/commit/675da3e119a8cf7605cd5c5a252abba3d5a7e9ab [^]

Related to ISSUE-49501: Warehouse related tests are not executed in Oracle

The COMMIT done by the AD_UPDATE_PINSTANCE procedure breaks the test's transaction.
The tests are deactivated in Oracle only by extending from a new abstract class that
centralizes this behavior.
On Postgres the tests are executed normally.

---
A src-test/org/openbravo/api/tests/importer/ApiImportMappingSkipOracleTest.java
M src-test/org/openbravo/api/tests/StandaloneTestSuite.java
M src-test/org/openbravo/api/tests/importer/ImportGoodsMovement.java
M src-test/org/openbravo/api/tests/importer/ImportInventory.java
---

- Issue History
Date Modified Username Field Change
2022-06-07 18:16 vmromanos New Issue
2022-06-07 18:16 vmromanos Assigned To => Triage Platform Base
2022-06-07 18:16 vmromanos Modules => Core
2022-06-07 18:16 vmromanos Triggers an Emergency Pack => No
2022-06-07 19:09 hgbot Note Added: 0138125
2022-06-08 07:11 alostale Relationship added related to 0019438


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker