Martin Mucha has posted comments on this change. Change subject: core: Make DAOs injectable ......................................................................
Patch Set 10: (1 comment) http://gerrit.ovirt.org/#/c/35793/10/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HibernateFacade.java File backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/HibernateFacade.java: Line 10: import javax.persistence.Query; Line 11: Line 12: /** Line 13: * A shared class for all DaoFacades that use Hibernate. Note that our code does not expect to work with attached Line 14: * entities, so returned entities are detached. There is an API for working with attached entities. "…so returned entities…" I'm not sure if that's true. I think you still can get reference to "attached" entity: persist and merge puts entity into persistence context, so after return from save of update, you have reference to „attached” entity. Maybe the entity should be detached in those methods as well. I don't know why there's need to detach them anyway, it should work just fine, but if it is, I think it should be reflected in save and update as well. The only think, why to detach, which comes to my mind is making sure that querying of lazy association would fail, but still not sure how that can cause trouble. Please tell me the details behind need to detach. Thanks. Line 15: * @author lzelkha Line 16: * @param <T> Line 17: * The entity Line 18: * @param <K> -- To view, visit http://gerrit.ovirt.org/35793 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia408a878fa0fa8dd8b414a60683c36d0db6d6641 Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liran Zelkha <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Barak Azulay <[email protected]> Gerrit-Reviewer: Eli Mesika <[email protected]> Gerrit-Reviewer: Liran Zelkha <[email protected]> Gerrit-Reviewer: Martin Mucha <[email protected]> Gerrit-Reviewer: Moti Asayag <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
