Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0036391 | Openbravo ERP | A. Platform | public | 2017-07-03 18:11 | 2017-09-21 16:49 | |||||||
Reporter | ngarcia | |||||||||||
Assigned To | alostale | |||||||||||
Priority | high | Severity | minor | Reproducibility | always | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | 3.0PR17Q4 | ||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | caristu | |||||||||||
OBNetwork customer | OBPS | |||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | 47355 | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0036391: inconsistent behavior of OBDal.get by entity name + id when trying to populate a proxy by entity name + id | |||||||||||
Description | When OBDal.get is used to get a record which ID does not exist in DB, it returns null. Previous statement is true as far as there was not a proxy for the same object in Hibernate cache, in this case an ObjectNotFoundException is thrown. | |||||||||||
Steps To Reproduce | 1. BusinessPartner bpProxy = (BusinessPartner) OBDal.getInstance().getProxy("BusinessPartner", "dummyId"); 2. final BusinessPartner bpartner = (BusinessPartner) OBDal.getInstance().get("BusinessPartner", "dummyId"); Then, the query breaks if the object does not exist in DB. | |||||||||||
Proposed Solution | Add catch clause in OBDal class in get method: public BaseOBObject get(String entityName, Object id) { checkReadAccess(entityName); try { return SessionHandler.getInstance().find(entityName, id); } catch (ObjectNotFoundException ignore) { return null; } } | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2017-07-03 18:11 | ngarcia | New Issue | ||||||||||
2017-07-03 18:11 | ngarcia | Assigned To | => platform | |||||||||
2017-07-03 18:11 | ngarcia | OBNetwork customer | => Yes | |||||||||
2017-07-03 18:11 | ngarcia | Modules | => Core | |||||||||
2017-07-03 18:11 | ngarcia | Support ticket | => 47355 | |||||||||
2017-07-03 18:11 | ngarcia | Triggers an Emergency Pack | => No | |||||||||
2017-07-03 18:11 | ngarcia | Issue generated from | 0034657 | |||||||||
2017-07-03 18:12 | ngarcia | Issue Monitored: networkb | ||||||||||
2017-07-03 18:13 | ngarcia | Relationship added | related to 0034657 | |||||||||
2017-07-04 11:17 | alostale | Assigned To | platform => alostale | |||||||||
2017-07-04 11:17 | alostale | Review Assigned To | => caristu | |||||||||
2017-07-04 11:18 | alostale | Summary | inconsistent behavior of OBDal.get when trying to get an inexistent record => inconsistent behavior of OBDal.get by entity name + id when trying to populate a proxy by entity name + id | |||||||||
2017-07-04 11:21 | hgbot | Checkin | ||||||||||
2017-07-04 11:21 | hgbot | Note Added: 0097830 | ||||||||||
2017-07-04 11:21 | hgbot | Status | new => resolved | |||||||||
2017-07-04 11:21 | hgbot | Resolution | open => fixed | |||||||||
2017-07-04 11:21 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/59f0b694423987416230f272f4164bc6f291c12c [^] | |||||||||
2017-07-04 20:09 | caristu | Note Added: 0097850 | ||||||||||
2017-07-04 20:09 | caristu | Status | resolved => closed | |||||||||
2017-07-04 20:09 | caristu | Fixed in Version | => 3.0PR17Q4 | |||||||||
2017-09-21 16:49 | hudsonbot | Checkin | ||||||||||
2017-09-21 16:49 | hudsonbot | Note Added: 0099232 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|