Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028909Retail ModulesWeb POSpublic2015-02-10 17:172016-03-08 20:36
alostale 
marvintm 
highmajoralways
closedduplicate 
20Community Appliance
 
 
Orekaria
Automated tests
No
0028909: can't create orders in Oracle
OrderLoader fails in Oracle because of incorrect invocation to M_GET_STOCK_PARAM procedure.

Current code invokes this procedure as a function.

In Oracle CallStoredProcedure can be used to invoke functions ("select function() from dual") and procedures ("call procedure()"), based on its returnResults parameter. Note this only affects Oracle because PostgreSQL doesn't differentiate functions and procedures.

Currently M_GET_STOCK_PARAM, which is a procedure with output parameters is being invoked as a function, that's the reason the exception is thrown.
. in oracle and Web POS
. in OrderLoader.java the called to M_GET_STOCK_PARAM procedure:
 error is returned:
  
Caused by: java.lang.IllegalStateException: java.sql.SQLSyntaxErrorException: ORA-00904: "M_GET_STOCK_PARAM": invalid identifier
    [junit]
    [junit] at org.openbravo.service.db.CallStoredProcedure.call(CallStoredProcedure.java:142)
    [junit] at org.openbravo.retail.posterminal.OrderLoader.callProcessGetStock(OrderLoader.java:1795)
    [junit] at org.openbravo.retail.posterminal.OrderLoader.createShipmentLines(OrderLoader.java:860)
    [junit] at org.openbravo.retail.posterminal.OrderLoader.saveRecord(OrderLoader.java:243)
Possible solutions:
-Invoke it as a procedure. In this case, output parameters will not be retrieved. Looking at the current code they are not used anyway. Note in this case output paramters are required to be passed as parameters in Oracle but not in PG.
-Use a CallableStatement. In this way it is possible to have the same code both for Oracle and PG. To do in this way it is necessary to indicate which are the output parameters.

See attached test cases implementing different approaches both for PG and ORA.
No tags attached.
duplicate of defect 0029180pi closed mtaal Retail Modules WebPOS build fails on Oracle 
related to design defect 0028875 acknowledged Triage Platform Base Openbravo ERP Class "CallStoredProcedure" does not support parameters of type out 
? StoredProcedure.java (4,872) 2015-02-10 17:26
https://issues.openbravo.com/file_download.php?file_id=7780&type=bug
Issue History
2015-02-10 17:17alostaleNew Issue
2015-02-10 17:17alostaleAssigned To => AugustoMauch
2015-02-10 17:17alostaleModules => Core
2015-02-10 17:17alostaleRegression level => Automated tests
2015-02-10 17:17alostaleTriggers an Emergency Pack => No
2015-02-10 17:17alostaleIssue generated from0028875
2015-02-10 17:18alostaleProjectOpenbravo ERP => Retail Modules
2015-02-10 17:18alostaleAssigned ToAugustoMauch => marvintm
2015-02-10 17:18alostaleCategoryA. Platform => Web POS
2015-02-10 17:19alostaleRelationship addedrelated to 0028875
2015-02-10 17:25alostaleDescription Updatedbug_revision_view_page.php?rev_id=7655#r7655
2015-02-10 17:25alostaleProposed Solution updated
2015-02-10 17:26alostaleFile Added: StoredProcedure.java
2015-03-06 11:22eduardo_ArgalStatusnew => scheduled
2015-03-06 11:22eduardo_ArgalAssigned Tomarvintm => eduardo_Argal
2015-03-06 11:28eduardo_ArgalAssigned Toeduardo_Argal => marvintm
2015-03-06 11:32hgbotCheckin
2015-03-06 11:32hgbotNote Added: 0075241
2015-03-06 16:52hgbotCheckin
2015-03-06 16:52hgbotNote Added: 0075258
2015-03-09 09:43malsasuaRelationship addedduplicate of 0029180
2015-03-09 17:49hudsonbotCheckin
2015-03-09 17:49hudsonbotNote Added: 0075332
2015-03-09 17:49hudsonbotCheckin
2015-03-09 17:49hudsonbotNote Added: 0075333
2016-03-08 20:36OrekariaReview Assigned To => Orekaria
2016-03-08 20:36OrekariaNote Added: 0084832
2016-03-08 20:36OrekariaStatusscheduled => closed
2016-03-08 20:36OrekariaResolutionopen => duplicate

Notes
(0075241)
hgbot   
2015-03-06 11:32   
Repository: erp/devel/pi
Changeset: ab393536c4bced9b793ae7c0672c95cdc26b1a07
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Fri Mar 06 11:31:38 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ab393536c4bced9b793ae7c0672c95cdc26b1a07 [^]

Related to issue 28909
can't create orders in Oracle. Created StockUtils class to enable calls to M_GET_STOCK_PARAM procedure
getting out params

H : Enter commit message. Lines beginning with 'HG:' are removed.

---
A src/org/openbravo/materialmgmt/CSResponseGetStockParam.java
A src/org/openbravo/materialmgmt/StockUtils.java
A src/org/openbravo/materialmgmt/StockUtils_data.xsql
---
(0075258)
hgbot   
2015-03-06 16:52   
Repository: erp/devel/pi
Changeset: e20da585bb7ef4e3d0c1a280b66f5d997e553f45
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Fri Mar 06 16:52:17 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e20da585bb7ef4e3d0c1a280b66f5d997e553f45 [^]

Related to issue 28909
Change variable definition to public to be able to retrieve the value

---
M src/org/openbravo/materialmgmt/CSResponseGetStockParam.java
---
(0075332)
hudsonbot   
2015-03-09 17:49   
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/ef8a16dd11b3 [^]
Maturity status: Test
(0075333)
hudsonbot   
2015-03-09 17:49   
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/ef8a16dd11b3 [^]
Maturity status: Test
(0084832)
Orekaria   
2016-03-08 20:36   
Fixed in 29180