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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036429
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2017-07-06 12:262017-09-21 16:49
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision415e2a692c2d
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036429: SqlC generates code using printStackTrace which should not be used

DescriptionThis issue is part of getting rid of bad logging especially by not using printStackTrace as it is logged on stdout (catalina.out) without timestamp of context information.

SqlC current generates printStackTrace in the code in a catch block when an exception is raised while closing the statement/connection.

This issue will change that code to use the standard/proper log4j call.

Also based on feedback from ALO it adds context information (full sql statement) to make debugging easier if that case should happen.
Steps To ReproduceCheck code generated from xsql and notice it using printStackTrace.
Proposed Solution-
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0036162 acknowledgedTriage Platform Base clean up openbravo.log 
related to defect 0036444 closedalostale SqlC generated code hides stack traces in case of error 

-  Notes
(0097905)
shuehner (administrator)
2017-07-06 12:28

Example change in the generated code:
@@ -117,8 +117,8 @@
     } finally {
       try {
         connectionProvider.releasePreparedStatement(st);
- } catch(Exception ignore){
- ignore.printStackTrace();
+ } catch(Exception e){
+ log4j.error("Error during release*Statement of query: " + strSql, e);
       }
     }
     return(updateCount);
(0097919)
hgbot (developer)
2017-07-06 16:01

Repository: erp/devel/pi
Changeset: 415e2a692c2da44c1c503cea8c5e259480b58336
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Jul 06 12:31:24 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/415e2a692c2da44c1c503cea8c5e259480b58336 [^]

Fixed 36429. Change code-generation to not use printStackTrace but log4j.error

printStackTrace should not be used but the standard log4j.error instead. This
changes the SqlC code-generator which had 1 common case left not following this.
Also it adds strSql as context to the logging message to make debugging easier.

---
M src-core/src/org/openbravo/data/Sqlc.java
---
(0097928)
alostale (manager)
2017-07-07 09:24

reviewed
(0097934)
hgbot (developer)
2017-07-07 10:22

Repository: erp/devel/pi
Changeset: a91838c63b773a0425c81b4c82dd1a395661aa07
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 07 10:21:47 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a91838c63b773a0425c81b4c82dd1a395661aa07 [^]

related to bug 36429: printStackTrace on sqlc queries

  Fixed cases that do not directly use generated classes but a static
  copy of them.

---
M src/org/openbravo/erpCommon/ad_process/AlertProcess.java
---
(0099244)
hudsonbot (developer)
2017-09-21 16: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/9750b78d3e5c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-07-06 12:26 shuehner New Issue
2017-07-06 12:26 shuehner Assigned To => shuehner
2017-07-06 12:26 shuehner Modules => Core
2017-07-06 12:26 shuehner Triggers an Emergency Pack => No
2017-07-06 12:26 shuehner Relationship added related to 0036162
2017-07-06 12:28 shuehner Note Added: 0097905
2017-07-06 16:01 hgbot Checkin
2017-07-06 16:01 hgbot Note Added: 0097919
2017-07-06 16:01 hgbot Status new => resolved
2017-07-06 16:01 hgbot Resolution open => fixed
2017-07-06 16:01 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/415e2a692c2da44c1c503cea8c5e259480b58336 [^]
2017-07-06 16:02 shuehner Review Assigned To => alostale
2017-07-07 09:24 alostale Note Added: 0097928
2017-07-07 09:24 alostale Status resolved => closed
2017-07-07 09:24 alostale Fixed in Version => 3.0PR17Q4
2017-07-07 10:22 hgbot Checkin
2017-07-07 10:22 hgbot Note Added: 0097934
2017-07-07 11:16 alostale Relationship added related to 0036444
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099244


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker