Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0024326 | Openbravo ERP | A. Platform | public | 2013-07-12 14:51 | 2013-09-26 14:36 |
|
Reporter | alostale | |
Assigned To | alostale | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0MP28 | |
Merge Request Status | |
Review Assigned To | shankarb |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0024326: Suboptimal parent tab getter for root tabs |
Description | KernelUtils.getParentTab(Tab tab) method returns parent's tab for parameter tab.
In case parameter tab is a root tab it returns null.
The issue is on how root tab is calculated, instead of looking at the tab level being 0, it does the same logic as for the rest of the tabs and returns null in case nothing is found.
Even this calculation is quite fast, it is done many times (at least whenever a record is selected in grid). |
Steps To Reproduce | - |
Proposed Solution | In case tablevel is 0 return null without any further check |
Additional Information | |
Tags | Performance |
Relationships | related to | defect | 0024412 | | closed | alostale | Random failures in FIC | related to | defect | 0024421 | 3.0MP28 | closed | alostale | ApplicationDictionaryCachedStructures is not thread safe |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2013-07-12 14:51 | alostale | New Issue | |
2013-07-12 14:51 | alostale | Assigned To | => alostale |
2013-07-12 14:51 | alostale | Modules | => Core |
2013-07-12 14:51 | alostale | Triggers an Emergency Pack | => No |
2013-07-12 14:55 | alostale | Note Added: 0059957 | |
2013-07-12 14:55 | alostale | Tag Attached: Performance | |
2013-07-12 14:56 | alostale | Note Edited: 0059957 | bug_revision_view_page.php?bugnote_id=0059957#r4877 |
2013-07-12 14:58 | alostale | Note Added: 0059958 | |
2013-07-12 15:02 | alostale | Review Assigned To | => shankarb |
2013-07-12 15:02 | alostale | Summary | Suboptimal parent tab getter => Suboptimal parent tab getter for root tabs |
2013-07-12 15:03 | hgbot | Checkin | |
2013-07-12 15:03 | hgbot | Note Added: 0059959 | |
2013-07-12 15:03 | hgbot | Status | new => resolved |
2013-07-12 15:03 | hgbot | Resolution | open => fixed |
2013-07-12 15:03 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/b0cfc1e495435ccb1bd58f8e55bebb30bd83c634 [^] |
2013-07-16 06:05 | shankarb | Note Added: 0059988 | |
2013-07-16 06:05 | shankarb | Status | resolved => closed |
2013-07-16 06:05 | shankarb | Fixed in Version | => 3.0MP26 |
2013-07-16 14:26 | hudsonbot | Checkin | |
2013-07-16 14:26 | hudsonbot | Note Added: 0060038 | |
2013-07-26 09:25 | egoitz | Note Added: 0060297 | |
2013-07-26 09:25 | egoitz | Status | closed => new |
2013-07-26 09:25 | egoitz | Resolution | fixed => open |
2013-07-26 09:25 | egoitz | Fixed in Version | 3.0MP26 => |
2013-07-26 09:29 | egoitz | Status | new => scheduled |
2013-07-26 09:37 | egoitz | Status | scheduled => resolved |
2013-07-26 09:37 | egoitz | Resolution | open => fixed |
2013-07-26 09:37 | egoitz | Review Assigned To | shankarb => egoitz |
2013-07-26 09:37 | egoitz | Status | resolved => closed |
2013-07-26 10:48 | alostale | Relationship added | related to 0024412 |
2013-07-26 11:03 | alostale | Note Added: 0060300 | |
2013-07-26 11:03 | alostale | Status | closed => new |
2013-07-26 11:03 | alostale | Resolution | fixed => open |
2013-07-26 11:08 | hgbot | Checkin | |
2013-07-26 11:08 | hgbot | Note Added: 0060301 | |
2013-07-26 20:32 | hudsonbot | Checkin | |
2013-07-26 20:32 | hudsonbot | Note Added: 0060318 | |
2013-07-29 12:27 | alostale | Relationship added | related to 0024421 |
2013-09-24 17:49 | hgbot | Checkin | |
2013-09-24 17:49 | hgbot | Note Added: 0061370 | |
2013-09-24 17:49 | hgbot | Status | new => resolved |
2013-09-24 17:49 | hgbot | Resolution | open => fixed |
2013-09-24 17:49 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/b0cfc1e495435ccb1bd58f8e55bebb30bd83c634 [^] => http://code.openbravo.com/erp/devel/pi/rev/d40d287ea91a0c156f9087d2d00fa03dd579a543 [^] |
2013-09-25 08:26 | alostale | Review Assigned To | egoitz => shankarb |
2013-09-25 19:56 | hudsonbot | Checkin | |
2013-09-25 19:57 | hudsonbot | Note Added: 0061394 | |
2013-09-26 14:35 | shankarb | Note Added: 0061414 | |
2013-09-26 14:35 | shankarb | Status | resolved => closed |
2013-09-26 14:36 | shankarb | Fixed in Version | => 3.0MP28 |
Notes |
|
(0059957)
|
alostale
|
2013-07-12 14:55
(edited on: 2013-07-12 14:56) |
|
Executing this test, which calculates parent's tab of root tabs before and after the fix:
OBCriteria<Tab> qTab = OBDal.getInstance().createCriteria(Tab.class);
qTab.add(Restrictions.eq(Tab.PROPERTY_TABLEVEL, 0L));
qTab.addOrderBy(Tab.PROPERTY_ID, true);
List<String> tabIds = new ArrayList<String>();
for (Tab tab : qTab.list()) {
tabIds.add(tab.getId());
}
long t = System.currentTimeMillis();
for (String tabId : tabIds) {
Tab tab = OBDal.getInstance().get(Tab.class, tabId);
KernelUtils.getInstance().getParentTab(tab);
// clear session not to reuse cached tab, so it is more similar to actual usage
OBDal.getInstance().getSession().clear();
}
System.out.println("Time: " + (System.currentTimeMillis() - t));
Before: time 1500ms
After: time 360ms
Note in both cases ~300ms is spent in DB queries before the method, so after the fix the time is ~0 vs ~1200ms
|
|
|
|
Regression risk none.
Executed test plan before and after the fix:
OBCriteria<Tab> qTab = OBDal.getInstance().createCriteria(Tab.class);
qTab.addOrderBy(Tab.PROPERTY_ID, true);
List<String> tabIds = new ArrayList<String>();
for (Tab tab : qTab.list()) {
tabIds.add(tab.getId());
}
for (String tabId : tabIds) {
Tab tab = OBDal.getInstance().get(Tab.class, tabId);
System.out.println(tab + "-" + KernelUtils.getInstance().getParentTab(tab));
}
and compared outputs, they are identical. Meaning this change doesn't modify returned parent tab for any of the ones in the system. |
|
|
(0059959)
|
hgbot
|
2013-07-12 15:03
|
|
|
|
(0059988)
|
shankarb
|
2013-07-16 06:05
|
|
Code reviewed and tested in pi changeset 436cd2fa79fc. |
|
|
|
|
|
(0060297)
|
egoitz
|
2013-07-26 09:25
|
|
After apply that change the following error is continuosly raised:
17ed39e2 2013-07-23 05:28:31,588 [ajp-8809-7] ERROR org.hibernate.LazyInitializationException - could not initialize proxy - no Session |
|
|
|
Reopening the bug as it creates a regression: 0024412 |
|
|
(0060301)
|
hgbot
|
2013-07-26 11:08
|
|
|
|
|
|
|
(0061370)
|
hgbot
|
2013-09-24 17:49
|
|
Repository: erp/devel/pi
Changeset: d40d287ea91a0c156f9087d2d00fa03dd579a543
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jul 30 10:36:44 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d40d287ea91a0c156f9087d2d00fa03dd579a543 [^]
fixed bug 24421, fixed bug 24326: ADCachedStructures thread safe issues
-getTab now completely initializes all tabs in the window
-it is now synchronized
Added test cases to check it
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ApplicationDictionaryCachedStructures.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelUtils.java
M src-test/org/openbravo/test/AllAntTaskTests.java
A src-test/org/openbravo/test/base/HiddenObjectHelper.java
A src-test/org/openbravo/test/dal/ADCachedMultiThreadTest.java
---
|
|
|
|
|
|
(0061414)
|
shankarb
|
2013-09-26 14:35
|
|
Code reviewed and verified in pi changeset f497481ca351. |
|