Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CommitIntegrityException while using transaction.setCommittables
[CDO] CommitIntegrityException while using transaction.setCommittables [message #1416188] Thu, 04 September 2014 14:23 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi all,

I use the Graphiti framework to create diagrams which are EMF models that I store in a CDO repository in dedicated resources (one per diagram).

And, before I commit any change in a diagram, I specify the committables : the whole resource content (using cdoResource().getAllContents()).

When I move an element in my diagram and save it in CDO, it works just fine.
And the committables are :

In committables : Point@OID165
In committables : Shape@OID145
In committables : PictogramLink@OID141
In committables : Text@OID162
In committables : PictogramLink@OID128
In committables : Point@OID138
In committables : DiagramMetaData@OID122
In committables : Text@OID146
In committables : ChopboxAnchor@OID164
In committables : PictogramLink@OID163
In committables : RoundedRectangle@OID125
In committables : Color@OID156
In committables : Point@OID160
In committables : Polyline@OID151
In committables : FreeFormConnection@OID150
In committables : Color@OID120
In committables : CommitInfo@OID169
In committables : Color@OID121
In committables : Shape@OID158
In committables : ContainerShape@OID124
In committables : Polyline@OID159
In committables : Rectangle@OID119
In committables : ChopboxAnchor@OID137
In committables : PictogramLink@OID157
In committables : Shape@OID161
In committables : Application@OID123
In committables : Text@OID133
In committables : ContainerShape@OID154
In committables : PictogramLink@OID147
In committables : Point@OID144
In committables : Shape@OID129
In committables : Polyline@OID130
In committables : Point@OID131
In committables : CDOResource@OID117[DIRTY]("Application_App1_1409837051664")
In committables : Color@OID134
In committables : RoundedRectangle@OID155[DIRTY]
In committables : ContainerShape@OID139
In committables : Shape@OID132
In committables : Polyline@OID167
In committables : CommitInfo@oid1[NEW]
In committables : Color@OID127
In committables : PictogramLink@OID153
In committables : Point@OID149
In committables : Polyline@OID143
In committables : Font@OID135
In committables : FreeFormConnection@OID166
In committables : RoundedRectangle@OID140
In committables : Shape@OID142
In committables : Color@OID152
In committables : PictogramLink@OID136
In committables : PictogramLink@OID168
In committables : Color@OID126
In committables : Diagram@OID118
In committables : ChopboxAnchor@OID148

The dirty rounded rectangle with OID155 corresponds to the moved element.

But, if I resize this element and try to save it, I then get a commit integrity exception :

In committables : CommitInfo@oid2[NEW]
In committables : Shape@OID145
In committables : PictogramLink@OID141
In committables : Text@OID162[DIRTY]
In committables : PictogramLink@OID128
In committables : Point@OID138
In committables : DiagramMetaData@OID122
In committables : Text@OID146
In committables : ChopboxAnchor@OID164
In committables : PictogramLink@OID163
In committables : RoundedRectangle@OID125
In committables : Color@OID156
In committables : Point@OID160
In committables : Polyline@OID151
In committables : Point@oid1[NEW]
In committables : FreeFormConnection@OID150
In committables : Color@OID120
In committables : CommitInfo@OID169
In committables : Color@OID121
In committables : Shape@OID158
In committables : ContainerShape@OID124
In committables : Polyline@OID159[DIRTY]
In committables : Rectangle@OID119
In committables : ChopboxAnchor@OID137
In committables : PictogramLink@OID157
In committables : Shape@OID161
In committables : Application@OID123
In committables : Text@OID133
In committables : ContainerShape@OID154
In committables : PictogramLink@OID147
In committables : Point@OID144
In committables : Shape@OID129
In committables : Polyline@OID130
In committables : Point@OID131
In committables : CDOResource@OID117[DIRTY]("Application_App1_1409837051664")
In committables : Color@OID134
In committables : RoundedRectangle@OID155[DIRTY]
In committables : ContainerShape@OID139
In committables : Shape@OID132
In committables : Polyline@OID167
In committables : CommitInfo@OID171
In committables : Color@OID127
In committables : PictogramLink@OID153
In committables : Point@OID149
In committables : Polyline@OID143
In committables : Font@OID135
In committables : FreeFormConnection@OID166
In committables : RoundedRectangle@OID140
In committables : Shape@OID142
In committables : Color@OID152
In committables : PictogramLink@OID136
In committables : PictogramLink@OID168
In committables : Color@OID126
In committables : Diagram@OID118
In committables : ChopboxAnchor@OID148
...
Caused by: org.eclipse.emf.cdo.util.CommitIntegrityException: The removed child / refTarget of object Polyline@OID159[DIRTY] needs to be included in the commit but isn't
at org.eclipse.emf.internal.cdo.util.CommitIntegrityCheck.createException(CommitIntegrityCheck.java:365)
at org.eclipse.emf.internal.cdo.util.CommitIntegrityCheck.checkIncluded(CommitIntegrityCheck.java:358)
at org.eclipse.emf.internal.cdo.util.CommitIntegrityCheck.checkFeatureDelta(CommitIntegrityCheck.java:273)
at org.eclipse.emf.internal.cdo.util.CommitIntegrityCheck.analyzeRevisionDelta(CommitIntegrityCheck.java:202)
at org.eclipse.emf.internal.cdo.util.CommitIntegrityCheck.check(CommitIntegrityCheck.java:107)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl$CDOCommitContextImpl.preCommit(CDOTransactionImpl.java:3066)
... 13 more

Once again, the rounded rectangle with OID155 is marked as dirty, as well as a polyline (OID159) and a text (OID162).
The resized element is the rounded rectangle, divided in two parts by the polyline, with a text (the element name) displayed in the upper part.

The exception message indicates the polyline has been removed which is not the case.
It also claims that the polyline should be included in the commit which, I believe, is ok because of being in the commitables.

Any idea what's wrong ?

Kind regards,

Laurent
Re: [CDO] CommitIntegrityException while using transaction.setCommittables [message #1416469 is a reply to message #1416188] Thu, 04 September 2014 19:21 Go to previous messageGo to next message
Leonid Ripeynih is currently offline Leonid RipeynihFriend
Messages: 150
Registered: February 2012
Senior Member
Hi, Laurent.

The answer is in how Graphiti framework 'resizes' you Polyline. If you look at the method org.eclipse.graphiti.services.impl.GaServiceImpl.movePolylinePoint(Polyline, int, int, int), you will notice that it does not 'change' the point objects contained in Polyling, it replaces a Point object with a new one. So, you have one [DIRTY] object (Polyline@OID159[DIRTY]), one [NEW] object (Point@oid1[NEW]) and one [DETACHED] object (removed Point). Of course, the [DETACHED] Point is not in the eAllContents() anymore, well, because it's detached.

You can use org.eclipse.emf.cdo.transaction.CDOTransaction.getDetachedObjects() API to add all detached objects to you commitables.

Hope this helps.
Re: [CDO] CommitIntegrityException while using transaction.setCommittables [message #1417508 is a reply to message #1416469] Fri, 05 September 2014 16:03 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi Leonid,

After selecting in my transaction only the detached objects corresponding to the resource I want to commit, it works great !
Many thanks for your help,

Laurent
Previous Topic:JET - Understanding @start and @end
Next Topic:Prevent elements to be moved from one container to another
Goto Forum:
  


Current Time: Thu Oct 24 04:42:46 GMT 2019

Powered by FUDForum. Page generated in 0.01615 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top