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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0005446
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 02. Master data managementmajoralways2008-10-06 19:352009-03-03 17:16
ReporterCrosiarCMView Statuspublic 
Assigned Tovmromanos 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branch2.40Fixed in SCM revision8307
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

0005446: 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 ]
blocks defect 0005375 closedvmromanos Import Account fails 

-  Notes
(0009400)
svnbot (reporter)
2008-10-06 20:21

Repository: openbravo
Revision: 8291
Author: vmromanos
Date: 2008-10-06 20:21:51 +0200 (Mon, 06 Oct 2008)

Fixed bug 0005446: Import Account fails

---
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ImportAccount.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ImportAccount_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=8291&sc=1 [^]

- Issue History
Date Modified Username Field Change
2008-10-06 19:35 vmromanos New Issue
2008-10-06 19:35 vmromanos Assigned To => vmromanos
2008-10-06 19:35 vmromanos Status new => scheduled
2008-10-06 20:21 svnbot Checkin
2008-10-06 20:21 svnbot Note Added: 0009400
2008-10-06 20:21 svnbot Status scheduled => resolved
2008-10-06 20:21 svnbot Resolution open => fixed
2008-10-06 20:21 svnbot svn_revision 8282 => 8291
2008-10-07 07:54 svnbot Checkin
2008-10-07 07:54 svnbot Note Added: 0009413
2008-10-07 07:54 svnbot svn_revision 8291 => 8307
2009-02-02 16:48 rafaroda Note Deleted: 0009413
2009-03-03 17:16 psarobe Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker