Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0033794 | Openbravo ERP | A. Platform | public | 2016-08-24 14:21 | 2016-08-26 13:21 |
|
Reporter | shuehner | |
Assigned To | shuehner | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR16Q4 | |
Merge Request Status | |
Review Assigned To | caristu |
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 | 0033794: Accidental double queries in DataSourceServiceProvider.getDataSourceFromDataSourceName |
Description | That function calls .list() twice on same instance leading do sql query run twice.
As the filter used is for a field (name) having a unique constraint double .list() usage can be simplified to just .uniqueResult as the case of >1 result rows cannot happen. |
Steps To Reproduce | with debugging code from https://issues.openbravo.com/view.php?id=33767 [^] applied
run try (erp) and observe debugging output during try-initial-pgsql job
Unknwown which exact UI action triggers this special case which is 'get datasourceByName compared to getting it byId.
See logic in getRealDataSource for the difference in calling. |
Proposed Solution | |
Additional Information | |
Tags | Performance |
Relationships | related to | feature request | 0033767 | | closed | platform | Add code to auto-detect 'accidental double query' on same OBQuery or OBCriteria object |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2016-08-24 14:21 | shuehner | New Issue | |
2016-08-24 14:21 | shuehner | Assigned To | => platform |
2016-08-24 14:21 | shuehner | Modules | => Core |
2016-08-24 14:21 | shuehner | Triggers an Emergency Pack | => No |
2016-08-24 14:21 | shuehner | Tag Attached: Performance | |
2016-08-24 14:21 | shuehner | Relationship added | related to 0033767 |
2016-08-24 14:24 | hgbot | Checkin | |
2016-08-24 14:24 | hgbot | Note Added: 0089345 | |
2016-08-24 14:24 | hgbot | Status | new => resolved |
2016-08-24 14:24 | hgbot | Resolution | open => fixed |
2016-08-24 14:24 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/4dddd6f401c6cf36a2aa5af49458abe2f8c5280f [^] |
2016-08-24 14:24 | shuehner | Review Assigned To | => caristu |
2016-08-24 15:00 | shuehner | Assigned To | platform => shuehner |
2016-08-25 10:52 | caristu | Note Added: 0089385 | |
2016-08-25 10:52 | caristu | Status | resolved => closed |
2016-08-25 10:52 | caristu | Fixed in Version | => 3.0PR16Q4 |
2016-08-26 08:25 | hgbot | Checkin | |
2016-08-26 08:25 | hgbot | Note Added: 0089425 | |
2016-08-26 13:21 | hudsonbot | Checkin | |
2016-08-26 13:21 | hudsonbot | Note Added: 0089456 | |
Notes |
|
(0089345)
|
hgbot
|
2016-08-24 14:24
|
|
Repository: erp/devel/pi
Changeset: 4dddd6f401c6cf36a2aa5af49458abe2f8c5280f
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Wed Aug 24 14:23:41 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4dddd6f401c6cf36a2aa5af49458abe2f8c5280f [^]
Fixed 33794. Avoid double .list() call by using .uniqueResult() instead.
Code did check for >1 result rows while reading from obserds_datasource.
However as the filter is on the name column and that column has an unique
constraint that case of >1 cannot happen.
So simplify to just call .uniqueResult() removing both .list() calls.
---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java
---
|
|
|
|
|
|
(0089425)
|
hgbot
|
2016-08-26 08:25
|
|
Repository: erp/devel/pi
Changeset: 6914648cfa1df0c0e6a305a83addadaee01b8f22
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Aug 26 08:24:54 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6914648cfa1df0c0e6a305a83addadaee01b8f22 [^]
related to issue 33794: updated copyright year
---
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java
---
|
|
|
|
|