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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0005375
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2008-10-02 08:002008-12-16 09:42
ReporterCrosiarCMView Statuspublic 
Assigned Tovmromanos 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchpiFixed in SCM revision8290
ProjectionnoneETAnoneTarget Version
OSLinux 32 bitDatabaseAnyJava version1.6
OS VersionDebian UnstableDatabase version8.3.1Ant version1.7.0
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0005375: Import Account fails

DescriptionThere 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 ReproduceMaster Data Management || Import Data || Import Account || Import Account
Proposed SolutionFor 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.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0005446 closedvmromanos Import Account fails 

-  Notes
(0009392)
svnbot (reporter)
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 (reporter)
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 [^]

- Issue History
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
Powered by Mantis Bugtracker