Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Strange behaviour of DELETE operation
Strange behaviour of DELETE operation [message #1288757] Tue, 08 April 2014 21:08 Go to next message
Arek Kowal is currently offline Arek KowalFriend
Messages: 10
Registered: April 2014
Junior Member
I think that after deletion dabatabase is not consistent...

A (cdoid 4114) contains B (cdoid: 4118 & 4119)

I removed B - numbers: 4118 and 4119.

Table A - OK :

Cdo_id cdo_version ownedB

4114 1 2

4114 2 1

4114 3 0

Table B - OK :

Cdo_id cdo_version cdo_revised

4118 -2 0

4118 1 1396522535496

4119 -2 0

4119 1 1396523470887

Table A_ownedB_list - Bad structure :

Cdo_source cdo_version cdo_value

4114 1 4118

4114 1 4119

4114 2 4119


- Why don't I have something like: 4114 3 null etc. ?



[Updated on: Wed, 09 April 2014 13:09]

Report message to a moderator

Re: Strange behaviour of DELETE operation [message #1289591 is a reply to message #1288757] Wed, 09 April 2014 13:01 Go to previous message
Arek Kowal is currently offline Arek KowalFriend
Messages: 10
Registered: April 2014
Junior Member
Code:

                Resource resource = CDOAeess.getDefaultResource(cdoTransaction);
                
                CDOQuery cdoq = cdoTransaction.createQuery("sql", "select * from B where cdo_id = '" + id + "' and cdo_revised = 0 and cdo_version >= 0");
                B b = cdoq.getResultValue(B.class);
              
                cdoq = cdoTransaction.createQuery("sql", "select cdo_container from B where cdo_id = '" + id + "' and cdo_revised = 0 and cdo_version >= 0");
                A a = cdoq.getResultValue(A.class);
                                
                a.getOwnedB().remove(b); 
                resource.getContents().remove(b);  
                
                return Response.status(Status.OK).build();
            }
        


[Updated on: Wed, 09 April 2014 13:02]

Report message to a moderator

Previous Topic:EMF composite change
Next Topic:[CDO] RootResourceID is null; is the repository not yet initialized?
Goto Forum:
  


Current Time: Thu Apr 25 19:51:27 GMT 2024

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

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

Back to the top