Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #34657 Back to Issue ]
Summary 0034657: inconsistent behavior of OBDal.get when trying to get an inexistent record
Revision 2016-12-01 16:06 by alostale
Steps To Reproduce 1. BusinessPartner bpProxy = OBDal.getInstance().getProxy(BusinessPartner.class, "dummyId");
2. final BusinessPartner bpartner = OBDal.getInstance().get(BusinessPartner.class, "dummyId");

Then, the query breaks if the object does not exist in DB.

Workaround: If we use "OBDal.getInstance().getSession().evict(bpProxy);" sentence before make the query, it works succesfully
Revision 2016-12-01 16:06 by alostale
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.

Revision 2016-12-01 14:14 by alostale
Steps To Reproduce 1. BusinessPartner bpProxy = OBDal.getInstance().getProxy(BusinessPartner.class,
        source.getSourceTechnicalHeader().getCustomerID());
2. final BusinessPartner bpartner = OBDal.getInstance().get(BusinessPartner.class,
          source.getSourceTechnicalHeader().getCustomerID());

Then, the query breaks if the object does not exist in DB.

If we use "OBDal.getInstance().getSession().evict(bpProxy);" sentence before make the query, it works succesfully
Revision 2016-12-01 14:14 by alostale
Description When we try to make a query of any object that not exist in DB but we have a proxy opened before, the query breaks instead of return null.


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker