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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0029910
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorsometimes2015-05-18 10:302015-11-23 21:17
ReporteryogaskarnikView Statuspublic 
Assigned Toplatform 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q1
StatusclosedFix in branchFixed in SCM revisionc365fc9d4bd0
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0PR15Q1SCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0029910: exporting grid to csv can fail if audit fields are included

DescriptionUnder certain circumstances when trying to export a grid to csv including audit columns it can fail.

When this happens:
* The CSV file contains a single line with:
{"response":{"status":-4,"error":{"message":"Error while exporting a CSV file", "type":"system"}}}
* This exception appears in openbravo.log:
370815 [http-8080-1] ERROR org.openbravo.client.kernel.KernelUtils - Error while exporting a CSV file
org.openbravo.base.exception.OBException: Error while exporting a CSV file
    at org.openbravo.service.datasource.DataSourceServlet$QueryJSONWriterToCSV.<init>(DataSourceServlet.java:493)
...
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: ADElement.aDElementTrlList, no session or session was closed
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
    at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
    at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
    at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
    at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272)
    at org.openbravo.client.application.window.OBViewUtil.getLabel(OBViewUtil.java:130)

See steps to reproduce: the problem is OBViewUtil caches audit elements, but initially not their possible translations required for labeling csv columns. Step 6 initalizes those elements but translations only for one of them, steps 8 tries to get label from proxy of a DAL object which session is not longer in the thread.
Steps To ReproduceIn an instance with *no* modules in development:
1. Open Sales Order window
2. Restart Tomcat (so JVM caches are restarted also)
3. Login with the same browser used in step 1 (without cleaning its cache)
4. Open Sales Order window (at this point view is not requested because it is cached in browser)
5. Add Created column to grid
6. Export to csv
7. Add Updated column to grid
8. Export to csv
  -> FAILS with error mentioned above
TagsNo tags attached.
Attached Fileslog file icon openbravo70.log [^] (19,239 bytes) 2015-05-18 10:30

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00227643.0MP20 closedalostale cannot open any window 
has duplicate defect 0030289 closedplatform Sometimes the export to csv fails 
related to defect 0028477 closedalostale view generation: unneeded queries to trl tables 

-  Notes
(0081659)
hgbot (developer)
2015-11-10 16:26

Repository: erp/devel/pi
Changeset: c365fc9d4bd06bc989248419e9bbd6fd98891ea6
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Nov 10 16:26:06 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c365fc9d4bd06bc989248419e9bbd6fd98891ea6 [^]

fixed bug 29910: exporting grid to csv can fail if audit fields are included

  This error was caused by a partial initialization of audit elements in OBViewUtil,
  when this occured and label for one of these elements was tried to be obtained,
  LazyInitializationException was thrown.

  It has been fixed by forcing complete initialization of the elements and their
  translations.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewUtil.java
---
(0081695)
caristu (developer)
2015-11-11 11:36

Code review + tested OK.

Following the Steps To Reproduce, now CSV file is always exported correctly.
(0082195)
hudsonbot (developer)
2015-11-23 21:17

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/7b56bebaaa88 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-05-18 10:30 yogaskarnik New Issue
2015-05-18 10:30 yogaskarnik Assigned To => platform
2015-05-18 10:30 yogaskarnik File Added: openbravo70.log
2015-05-18 10:30 yogaskarnik Modules => Core
2015-05-18 10:30 yogaskarnik Triggers an Emergency Pack => No
2015-06-30 17:09 caristu Relationship added has duplicate 0030289
2015-11-10 15:27 alostale Relationship added related to 0022764
2015-11-10 16:05 alostale Reproducibility unable to reproduce => sometimes
2015-11-10 16:05 alostale Summary Cannot export data from window that has dates (created, updated) in the grid => exporting grid to csv can fail if audit fields are included
2015-11-10 16:05 alostale Description Updated View Revisions
2015-11-10 16:05 alostale Steps to Reproduce Updated View Revisions
2015-11-10 16:09 alostale Description Updated View Revisions
2015-11-10 16:09 alostale Steps to Reproduce Updated View Revisions
2015-11-10 16:26 hgbot Checkin
2015-11-10 16:26 hgbot Note Added: 0081659
2015-11-10 16:26 hgbot Status new => resolved
2015-11-10 16:26 hgbot Resolution open => fixed
2015-11-10 16:26 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c365fc9d4bd06bc989248419e9bbd6fd98891ea6 [^]
2015-11-10 16:26 alostale Review Assigned To => caristu
2015-11-10 18:29 egoitz Issue Monitored: egoitz
2015-11-11 11:36 caristu Note Added: 0081695
2015-11-11 11:36 caristu Status resolved => closed
2015-11-11 11:36 caristu Fixed in Version => 3.0PR16Q1
2015-11-12 18:13 alostale Relationship added related to 0028477
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082195


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker