Liran Zelkha has posted comments on this change. Change subject: core: Add JPA Java infrastructure ......................................................................
Patch Set 20: (3 comments) http://gerrit.ovirt.org/#/c/33835/20//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2014-10-06 11:30:27 +0300 Line 4: Commit: lzel...@redhat.com <lzel...@redhat.com> Line 5: CommitDate: 2014-12-02 14:47:39 +0200 Line 6: Line 7: core: Add JPA Java infrastructure > i would appreciate if titles of commits will be a bit different from patch They are - one if infra and one is Java Line 8: Line 9: Create classes to assist in JPA development Line 10: Line 11: Change-Id: Ide82bf8cc647426e37dc42a113867c52699c3f0b http://gerrit.ovirt.org/#/c/33835/20/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 27: } Line 28: } Line 29: } Line 30: em = emf.createEntityManager(); Line 31: tl.set(em); > Could you elaborate on this ? It's a common pattern without injection. Since transactions are not shared - not a problem. See here for instance - http://opensourzesupport.wordpress.com/2012/10/30/entitymanager/ Line 32: } Line 33: return em; Line 34: } Line 35: Line 43: Line 44: public void save(T entity) { Line 45: EntityManager em = getEntityManager(); Line 46: Line 47: if (!em.getTransaction().isActive()) { > When we use the BaseDAODbFacade, at this stage of saving data to the databa That's what we're doing here. Line 48: em.getTransaction().begin(); Line 49: } Line 50: em.merge(entity); Line 51: if (autoCommit) { -- To view, visit http://gerrit.ovirt.org/33835 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide82bf8cc647426e37dc42a113867c52699c3f0b Gerrit-PatchSet: 20 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches