Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0005375 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 02. Master data management | major | always | 2008-10-02 08:00 | 2008-12-16 09:42 | |||
Reporter | CrosiarCM | View Status | public | |||||
Assigned To | vmromanos | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | pi | Fixed in SCM revision | 8290 | |||
Projection | none | ETA | none | Target Version | ||||
OS | Linux 32 bit | Database | Any | Java version | 1.6 | |||
OS Version | Debian Unstable | Database version | 8.3.1 | Ant version | 1.7.0 | |||
Product Version | pi | SCM revision | ||||||
Merge Request Status | ||||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0005375: Import Account fails | |||||||
Description | There are actually 2 issues here. The first is a bug when processing operands. 1. In the ImportAccountData.insertOperands method the sign is passed as a parameter as a string when the field is a numeric which raises a SQL exception. 2. I suspect the next issue is a Postgres only problem. Here is the code snippet in question from ImportAccount.java: if (log4j.isDebugEnabled()) log4j.debug("I_ElementValue_ID=" + I_ElementValue_ID + ", elementValue=" + elementValue); try { String [][] strOperand = operandProcess(ImportAccountData.selectOperands(conn, I_ElementValue_ID)); String strSeqNo = "10"; for(int j=0;strOperand!=null && j<strOperand.length;j++){ String C_ElementValue_Operand_ID = SequenceIdData.getSequence(conn, "C_ElementValue_Operand", vars.getClient()); String strAccount = ImportAccountData.selectAccount(con, conn, strOperand[j][0], vars.getClient()); String strElementValue = ImportAccountData.selectAccount(con, conn, elementValue, vars.getClient()); if(strAccount!=null && !strAccount.equals("")){ ImportAccountData.insertOperands(con, conn, C_ElementValue_Operand_ID, (strOperand[j][1].equals("+")?"1":"-1"), strElementValue, strAccount, strSeqNo, vars.getClient(), vars.getUser()); strSeqNo = nextSeqNo(strSeqNo); } else { if (log4j.isDebugEnabled()) log4j.debug("Operand not inserted - Value = " + strOperand[j][0]); } } } catch (ServletException ex) { log4j.warn("ServletException I_ElementValue_ID=" + I_ElementValue_ID); continue; } It is clear that the original intention was for an error to affect only the current element being processed, but in fact, on Postgres, all subsequent SQL commands will fail with a transaction aborted message. These will effectively be ignored in this loop, but the next query outside the loop will fail, aborting the account import. | |||||||
Steps To Reproduce | Master Data Management || Import Data || Import Account || Import Account | |||||||
Proposed Solution | For problem 1 the solution is easy, just change the parameter type. But for the second issue I'm not sure how to get Postgres to continue after the first error is encountered and the transaction has been aborted. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0009392) svnbot (viewer) 2008-10-06 16:47 |
Repository: openbravo Revision: 8282 Author: vmromanos Date: 2008-10-06 16:47:38 +0200 (Mon, 06 Oct 2008) Issue 0005375: Iteration 1; added TO_NUMBER() function for the numeric fields. --- U trunk/src/org/openbravo/erpCommon/ad_process/ImportAccount_data.xsql --- https://dev.openbravo.com/websvn/openbravo/?rev=8282&sc=1 [^] |
(0009399) svnbot (viewer) 2008-10-06 19:52 |
Repository: openbravo Revision: 8290 Author: vmromanos Date: 2008-10-06 19:52:14 +0200 (Mon, 06 Oct 2008) Fixed bug 0005375: Iteration 2, Import Account fails. --- U trunk/src/org/openbravo/erpCommon/ad_process/ImportAccount.java U trunk/src/org/openbravo/erpCommon/ad_process/ImportAccount_data.xsql --- https://dev.openbravo.com/websvn/openbravo/?rev=8290&sc=1 [^] |
![]() |
|||
Date Modified | Username | Field | Change |
2008-10-02 08:00 | CrosiarCM | New Issue | |
2008-10-02 08:00 | CrosiarCM | Assigned To | => cromero |
2008-10-02 08:00 | CrosiarCM | sf_bug_id | 0 => 2141809 |
2008-10-02 08:01 | CrosiarCM | Issue Monitored: CrosiarCM | |
2008-10-06 12:36 | psarobe | Status | new => scheduled |
2008-10-06 12:36 | psarobe | Assigned To | cromero => vmromanos |
2008-10-06 12:36 | psarobe | fix_in_branch | => trunk |
2008-10-06 16:47 | svnbot | Checkin | |
2008-10-06 16:47 | svnbot | Note Added: 0009392 | |
2008-10-06 16:47 | svnbot | svn_revision | => 8282 |
2008-10-06 19:35 | vmromanos | Status | scheduled => feedback |
2008-10-06 19:35 | vmromanos | Status | feedback => scheduled |
2008-10-06 19:52 | svnbot | Checkin | |
2008-10-06 19:52 | svnbot | Note Added: 0009399 | |
2008-10-06 19:52 | svnbot | Status | scheduled => resolved |
2008-10-06 19:52 | svnbot | Resolution | open => fixed |
2008-10-06 19:52 | svnbot | svn_revision | 8282 => 8290 |
2008-12-16 09:42 | psarobe | Regression testing | => No |
2008-12-16 09:42 | psarobe | Status | resolved => closed |
Copyright © 2000 - 2009 MantisBT Group |