Hi,
I am using Cuba Platform Version 7.26 and I am looking for an simple way to add
some non-related entities in the commit-transaction of a screen (StandardEditor<>).
The reason is locking. I want to force versioning of this entities, which are related in the screen (without changing them) so that another user, who is working on the same entities is warned on save (or vice versa).
I tried to do something like:
Entity e1 = persistence.getEntityManager(dataStoreName).find(entity.class, id);
Entity e2 = persistence.getEntityManager(dataStoreName).find(entity.class, id);
…
then
e1.setDummyAttr(“new”);
e2.setDummyAttr(“new”);
and so on.
I tried in the onBeforeCommitChanges(…) - event
something like:
getScreenData().getDataContext().merge(e1);
getScreenData().getDataContext().merge(e2);
with no result at committing.
So what is wrong in this way ?
Regards,
Martin