Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||
| View Issue Details | |||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0033627 | Openbravo ERP | A. Platform | public | 2016-08-04 17:20 | 2016-08-30 10:07 | ||||||||
| Reporter | shuehner | ||||||||||||
| Assigned To | mtaal | ||||||||||||
| 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 | alostale | ||||||||||||
| OBNetwork customer | No | ||||||||||||
| Web browser | |||||||||||||
| Modules | Core | ||||||||||||
| Support ticket | |||||||||||||
| Regression level | |||||||||||||
| Regression date | |||||||||||||
| Regression introduced in release | |||||||||||||
| Regression introduced by commit | |||||||||||||
| Triggers an Emergency Pack | No | ||||||||||||
| Summary | 0033627: debug call in OBCriteria.count does trigger extra db query in some case | ||||||||||||
| Description | Given the following code: final OBCriteria<Locator> locators = OBDal.getInstance().createCriteria(Locator.class); locators.add(Restrictions.eq(Locator.PROPERTY_ACTIVE, true)); locators.add(Restrictions.eq(Locator.PROPERTY_WAREHOUSE, shipment.getWarehouse())); if (locators.count() == 1) { with 'shipment.getWarehouse() being a hibernate proxy (not initialized) Then this debug statement inside OBCriteria.count() log.debug("Counting using criteria " + toString()); Triggers init + sql db read of m_warehouse which is not really required. | ||||||||||||
| Steps To Reproduce | i.e. using POS OrderLoader which contains the above code (in some functional flow). It maybe easier to reproduce in some small isolated test-case. | ||||||||||||
| Proposed Solution | Wrap .debug in isDebugEnabled() to avoid calling toString() on it. | ||||||||||||
| Additional Information | |||||||||||||
| Tags | Performance | ||||||||||||
| Relationships |
| ||||||||||||
| Attached Files | https://issues.openbravo.com/file_download.php?file_id=9678&type=bug | ||||||||||||
| Issue History | |||||||||||||
| Date Modified | Username | Field | Change | ||||||||||
| 2016-08-04 17:20 | shuehner | New Issue | |||||||||||
| 2016-08-04 17:20 | shuehner | Assigned To | => platform | ||||||||||
| 2016-08-04 17:20 | shuehner | OBNetwork customer | => No | ||||||||||
| 2016-08-04 17:20 | shuehner | Modules | => Core | ||||||||||
| 2016-08-04 17:20 | shuehner | Triggers an Emergency Pack | => No | ||||||||||
| 2016-08-04 17:21 | shuehner | Tag Attached: Performance | |||||||||||
| 2016-08-04 17:21 | shuehner | Relationship added | related to 0033139 | ||||||||||
| 2016-08-04 17:22 | shuehner | Note Added: 0088823 | |||||||||||
| 2016-08-04 17:22 | shuehner | File Added: 33627.diff | |||||||||||
| 2016-08-07 10:08 | mtaal | Assigned To | platform => mtaal | ||||||||||
| 2016-08-07 16:25 | hgbot | Checkin | |||||||||||
| 2016-08-07 16:25 | hgbot | Note Added: 0088868 | |||||||||||
| 2016-08-07 16:25 | hgbot | Status | new => resolved | ||||||||||
| 2016-08-07 16:25 | hgbot | Resolution | open => fixed | ||||||||||
| 2016-08-07 16:25 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/2f8cbe2f7611ce4b89fe72e273a9c127c93bc952 [^] | ||||||||||
| 2016-08-08 10:20 | mtaal | Review Assigned To | => alostale | ||||||||||
| 2016-08-11 18:40 | hudsonbot | Checkin | |||||||||||
| 2016-08-11 18:40 | hudsonbot | Note Added: 0089043 | |||||||||||
| 2016-08-30 10:07 | alostale | Note Added: 0089531 | |||||||||||
| 2016-08-30 10:07 | alostale | Status | resolved => closed | ||||||||||
| 2016-08-30 10:07 | alostale | Fixed in Version | => 3.0PR16Q4 | ||||||||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||