Project:
| View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | ||||||||
| 0036391 | ||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
| defect | [Openbravo ERP] A. Platform | minor | always | 2017-07-03 18:11 | 2017-09-21 16:49 | |||
| Reporter | ngarcia | View Status | public | |||||
| Assigned To | alostale | |||||||
| Priority | high | Resolution | fixed | Fixed in Version | 3.0PR17Q4 | |||
| Status | closed | Fix in branch | Fixed in SCM revision | 59f0b6944239 | ||||
| Projection | none | ETA | none | Target Version | ||||
| OS | Any | Database | Any | Java version | ||||
| OS Version | Database version | Ant version | ||||||
| Product Version | SCM revision | |||||||
| 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; } } | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Relationships [ Relation Graph ]
[ Dependency Graph ]
|
||||||||
|
||||||||
Notes |
|
|
(0097830) hgbot (developer) 2017-07-04 11:21 |
Repository: erp/devel/pi Changeset: 59f0b694423987416230f272f4164bc6f291c12c Author: Asier Lostalé <asier.lostale <at> openbravo.com> Date: Tue Jul 04 11:16:39 2017 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/59f0b694423987416230f272f4164bc6f291c12c [^] fixed bug 36391: inconsistent behavior of OBDal.get getting an inexistent row When getting a DAL object by entity name + id that's already proxied in cache it throws a ObjectNotFoundException if it does not exist in DB. Standard API for OBDal.get methods is to return null in this case. --- M src-test/src/org/openbravo/test/dal/DalTest.java M src/org/openbravo/dal/service/OBDal.java --- |
|
(0097850) caristu (viewer) 2017-07-04 20:09 |
Code reviewed + tested OK |
|
(0099232) hudsonbot (viewer) 2017-09-21 16:49 |
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/9750b78d3e5c [^] Maturity status: Test |
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 | |
| Copyright © 2000 - 2009 MantisBT Group |