You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/dao/impl/jpa/JpaRelationshipDao.java
+13-2Lines changed: 13 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@
25
25
importconfig.MetamodelProvider;
26
26
importdao.RelationshipDao;
27
27
importjpa.manager.JPAManager;
28
+
importorg.omg.sysml.internal.WorkingDataVersion;
28
29
importorg.omg.sysml.lifecycle.Commit;
29
30
importorg.omg.sysml.lifecycle.DataVersion;
30
31
importorg.omg.sysml.lifecycle.impl.CommitImpl;
@@ -127,8 +128,10 @@ public List<Relationship> findAllByCommitRelatedElement(Commit commit, Element r
127
128
// Reverting to non-relational streaming
128
129
// TODO Commit is detached at this point. This ternary mitigates by requerying for the Commit in this transaction. A better solution would be moving transaction handling up to service layer (supported by general wisdom) and optionally migrating to using Play's @Transactional/JPAApi. Pros would include removal of repetitive transaction handling at the DAO layer and ability to interface with multiple DAOs in the same transaction (consistent view). Cons include increased temptation to keep transaction open for longer than needed, e.g. during JSON serialization due to the convenience of @Transactional (deprecated in >= 2.8.x), and the service, a higher level of abstraction, becoming aware of transactions. An alternative would be DAO-to-DAO calls (generally discouraged) and delegating to non-transactional versions of methods.
0 commit comments