Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] How to find the source of stale CDO-Objects
[CDO] How to find the source of stale CDO-Objects [message #1808784] Mon, 01 July 2019 15:00 Go to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 36
Registered: July 2009
Member
Hi,

I am currently maintaining a cdo based application (cdo 4.5) backed by an oracle db. I experience an issue with an 1-n relationship which looks like:
site 1<---->n examination

for some reason there exists a site where an examination stays stale - debugging into cdo revealed the call to getRevision returned with null.

However, when looking at the data in the database everything looks fine:

select s.cdo_id, s.CDO_REVISED, s.CDO_VERSION, sl.CDO_IDX, sl.CDO_SOURCE, sl.CDO_VALUE, sl.CDO_VERSION_ADDED, sl.CDO_VERSION_REMOVED, e.CDO_ID, e.CDO_VERSION, e.CDO_REVISED from v1_site s left join v1_site_examinations_list sl on s.CDO_ID=sl.cdo_source left join v1_exam e on sl.cdo_value=e.cdo_id where e.cdo_revised=0 AND s.cdo_revised=0 AND sl.cdo_version_removed IS NULL

390001 0 8 0 390001 410659 7 410659 1 0 <-- stale

390006 0 6 0 390006 390011 5 390011 1 0 <--- all others are ok
417981 0 16 0 417981 418130 3 418130 1 0
417985 0 8 0 417985 418131 3 418131 2 0
417989 0 10 0 417989 418132 3 418132 2 0
417993 0 15 0 417993 418133 3 418133 1 0

also there is an entry in cdo_objects with the id 410659.

Any idea what is going wrong here?

Best regards, Clemens
Re: [CDO] How to find the source of stale CDO-Objects [message #1808816 is a reply to message #1808784] Tue, 02 July 2019 09:07 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Quote:
select s.cdo_id, s.CDO_REVISED, s.CDO_VERSION, sl.CDO_IDX, sl.CDO_SOURCE, sl.CDO_VALUE, sl.CDO_VERSION_ADDED, sl.CDO_VERSION_REMOVED, e.CDO_ID, e.CDO_VERSION, e.CDO_REVISED from v1_site s left join v1_site_examinations_list sl on s.CDO_ID=sl.cdo_source left join v1_exam e on sl.cdo_value=e.cdo_id where e.cdo_revised=0 AND s.cdo_revised=0 AND sl.cdo_version_removed IS NULL


This does not appear to be the exact query which returned the results you showed. Where is sl.CDO_VERSION_REMOVED?


Quote:
390001 0 8 0 390001 410659 7 410659 1 0 <-- stale


I think that sl.CDO_VALUE is what can make a reference stale, CDOID 410659 in your case. Does an object with that CDOID exist?


Re: [CDO] How to find the source of stale CDO-Objects [message #1808830 is a reply to message #1808816] Tue, 02 July 2019 13:49 Go to previous messageGo to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 36
Registered: July 2009
Member
Hi Eike,

Thanks a lot for taking the time to look into this :)

Eike Stepper wrote on Tue, 02 July 2019 05:07

This does not appear to be the exact query which returned the results you showed. Where is sl.CDO_VERSION_REMOVED?


Sorry - it seems SQLDeveloper omits NULL-values when using the clipboard. CDO_VERSION_REMOVED was NULL for all rows:

390001 0 8 0 390001 410659 7 NULL 410659 1 0

Quote:
I think that sl.CDO_VALUE is what can make a reference stale, CDOID 410659 in your case. Does an object with that CDOID exist?


The content of cdo_objects is:
select * from cdo_objects where cdo_id=410659
410659 -498 1528272051331

also the other end of the relation (exam) seems to be fine:
select cdo_id, cdo_version, cdo_created, cdo_revised,cdo_resource, cdo_container, cdo_feature from v1_exam where cdo_id=410659
410659 1 1528359342356 0 0 390001 -36

So nothing revised or removed - I am quite puzzled :/

Br, Clemens

[Updated on: Tue, 02 July 2019 13:50]

Report message to a moderator

Re: [CDO] How to find the source of stale CDO-Objects [message #1808847 is a reply to message #1808830] Wed, 03 July 2019 04:51 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
From what I can see the DB indeed looks fine. Is your problem reproducible after a server restart?

Re: [CDO] How to find the source of stale CDO-Objects [message #1809099 is a reply to message #1808847] Tue, 09 July 2019 05:29 Go to previous messageGo to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 36
Registered: July 2009
Member
Hi Eike,

Quote:

From what I can see the DB indeed looks fine.


It seems I was sloppy when reviewing the db content - the object had a wrong value in cdo_class and therefor CDO tried to load it from the wrong table where the cdo_id was (of course) not present.
Sorry for asking here, I actually thought the problem would be more complex.

Thanks & best regards, Clemens
Re: [CDO] How to find the source of stale CDO-Objects [message #1809103 is a reply to message #1809099] Tue, 09 July 2019 07:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6457
Registered: July 2009
Senior Member
Linuxhippy Mising name wrote on Tue, 09 July 2019 07:29
the object had a wrong value in cdo_class and therefor CDO tried to load it from the wrong table


How can that happen? Did you try to migrate your data to a new version of the metadata?


Re: [CDO] How to find the source of stale CDO-Objects [message #1809644 is a reply to message #1809103] Fri, 19 July 2019 09:01 Go to previous message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 36
Registered: July 2009
Member
Quote:

How can that happen? Did you try to migrate your data to a new version of the metadata?


cdo_external_refs causes issues for us from time to time when using CDO 4.5.0.
Currently I am fighting another issue where an entry in cdo_external_refs is not created after extending the schema for the class itself (the attributes are there), despite storing the objects of that class (and using the non-existant ID in cdo_objects).
When loading the schema again, it bails out with "ID not found, schema inconsistent".

Because of these issues I'll try to migrate to a new target platform (based on the weekly CDO build of 20190517 + emf/eclipse core 3.15) - so far it seems to work really well - except for schema migration - I'll open another thread about this question.

Thanks & best regards, Clemens
Previous Topic:Set reference dynamically
Next Topic:Generic children don't appears in editor
Goto Forum:
  


Current Time: Thu Dec 12 18:52:32 GMT 2019

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

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

Back to the top