Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] OCL Queries
[CDO] OCL Queries [message #650941] Thu, 27 January 2011 08:53 Go to next message
Eclipse UserFriend
Originally posted by: info.dav85.de

Hello everyone,

i've got some problems with the ocl queries. I want to do a query like this:

CDOQuery oclQuery = cdoTransaction.createQuery("ocl",
"StringValue.allInstances()", TypesPackage.eINSTANCE.getStringValue());

StringValue is a class in my EMF model. The Server print the following
exception:

!MESSAGE Evaluation failed with an exception: Object OID2211 not found
in branch 0 at *
!STACK 0
org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID2211 not
found in branch 0 at *
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObje ct(AbstractCDOView.java:808)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:712)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:664)
at
org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:1)
....

If I query other classes in my model it works fine. A simple sql query
statement like "Select * From StringValue" works also fine.

Thanks!
David
Re: [CDO] OCL Queries [message #650952 is a reply to message #650941] Thu, 27 January 2011 09:40 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi David,

Are you sure that your repository does not contain any stale references (references to objects that have been deleted)?

In CDO 4.0 you can use the new repository property ensureReferentialIntegrity="true" to prevent this scenario. Of course this will consume some additional CPU cycles during commits.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 27.01.2011 09:53, schrieb David Hein:
> Hello everyone,
>
> i've got some problems with the ocl queries. I want to do a query like this:
>
> CDOQuery oclQuery = cdoTransaction.createQuery("ocl", "StringValue.allInstances()", TypesPackage.eINSTANCE.getStringValue());
>
> StringValue is a class in my EMF model. The Server print the following exception:
>
> !MESSAGE Evaluation failed with an exception: Object OID2211 not found in branch 0 at *
> !STACK 0
> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID2211 not found in branch 0 at *
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObje ct(AbstractCDOView.java:808)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:712)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:664)
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:1)
> ...
>
> If I query other classes in my model it works fine. A simple sql query statement like "Select * From StringValue" works also fine.
>
> Thanks!
> David


Re: [CDO] OCL Queries [message #650957 is a reply to message #650952] Thu, 27 January 2011 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: info.dav85.de

thank you very much! it works! :)

Am 27/01/2011 10:40, schrieb Eike Stepper:
> Hi David,
>
> Are you sure that your repository does not contain any stale references
> (references to objects that have been deleted)?
>
> In CDO 4.0 you can use the new repository property
> ensureReferentialIntegrity="true" to prevent this scenario. Of course
> this will consume some additional CPU cycles during commits.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 27.01.2011 09:53, schrieb David Hein:
>> Hello everyone,
>>
>> i've got some problems with the ocl queries. I want to do a query like
>> this:
>>
>> CDOQuery oclQuery = cdoTransaction.createQuery("ocl",
>> "StringValue.allInstances()", TypesPackage.eINSTANCE.getStringValue());
>>
>> StringValue is a class in my EMF model. The Server print the following
>> exception:
>>
>> !MESSAGE Evaluation failed with an exception: Object OID2211 not found
>> in branch 0 at *
>> !STACK 0
>> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID2211 not
>> found in branch 0 at *
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObje ct(AbstractCDOView.java:808)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:712)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:664)
>>
>> at
>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:1)
>>
>> ...
>>
>> If I query other classes in my model it works fine. A simple sql query
>> statement like "Select * From StringValue" works also fine.
>>
>> Thanks!
>> David
Re: [CDO] OCL Queries [message #650975 is a reply to message #650957] Thu, 27 January 2011 10:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: info.dav85.de

In the standard way without modifying data it works fine. But then I do
some modifications and the same problem come again.

In the database table i found some entries like this:

CDO_ID CDO_VERSION CDO_BRANCH CDO_REVISED ...

2657 -2 0 0
2657 1 0 1296123470213

2658 -2 0 0
2658 1 0 1296123470213

2659 -2 0 0
2659 1 0 1296123470213

Is it possible that i forget do update or delete some references in my
model?

Thanks.

Am 27/01/2011 11:06, schrieb David Hein:
> thank you very much! it works! :)
>
> Am 27/01/2011 10:40, schrieb Eike Stepper:
>> Hi David,
>>
>> Are you sure that your repository does not contain any stale references
>> (references to objects that have been deleted)?
>>
>> In CDO 4.0 you can use the new repository property
>> ensureReferentialIntegrity="true" to prevent this scenario. Of course
>> this will consume some additional CPU cycles during commits.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 27.01.2011 09:53, schrieb David Hein:
>>> Hello everyone,
>>>
>>> i've got some problems with the ocl queries. I want to do a query like
>>> this:
>>>
>>> CDOQuery oclQuery = cdoTransaction.createQuery("ocl",
>>> "StringValue.allInstances()", TypesPackage.eINSTANCE.getStringValue());
>>>
>>> StringValue is a class in my EMF model. The Server print the following
>>> exception:
>>>
>>> !MESSAGE Evaluation failed with an exception: Object OID2211 not found
>>> in branch 0 at *
>>> !STACK 0
>>> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID2211 not
>>> found in branch 0 at *
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObje ct(AbstractCDOView.java:808)
>>>
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:712)
>>>
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:664)
>>>
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:1)
>>>
>>>
>>> ...
>>>
>>> If I query other classes in my model it works fine. A simple sql query
>>> statement like "Select * From StringValue" works also fine.
>>>
>>> Thanks!
>>> David
>
Re: [CDO] OCL Queries [message #651047 is a reply to message #650975] Thu, 27 January 2011 14:31 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 27.01.2011 11:40, schrieb David Hein:
> In the standard way without modifying data it works fine. But then I do some modifications and the same problem come again.
>
> In the database table i found some entries like this:
>
> CDO_ID CDO_VERSION CDO_BRANCH CDO_REVISED ...
>
> 2657 -2 0 0
The -2 is a DBStore implementation detail, telling that object 2657 has been deleted in "version" 2. Please write down the cdo_created value of that row and check that you find nowhere in your DB any reference to 2657 that is valid at or after this cdo_created value (0 time means indefinitely).

> 2657 1 0 1296123470213
>
> 2658 -2 0 0
> 2658 1 0 1296123470213
>
> 2659 -2 0 0
> 2659 1 0 1296123470213
>
> Is it possible that i forget do update or delete some references in my model?
Yes, if you don't set ensureReferentialIntegrity="true" in the server.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thanks.
>
> Am 27/01/2011 11:06, schrieb David Hein:
>> thank you very much! it works! :)
>>
>> Am 27/01/2011 10:40, schrieb Eike Stepper:
>>> Hi David,
>>>
>>> Are you sure that your repository does not contain any stale references
>>> (references to objects that have been deleted)?
>>>
>>> In CDO 4.0 you can use the new repository property
>>> ensureReferentialIntegrity="true" to prevent this scenario. Of course
>>> this will consume some additional CPU cycles during commits.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 27.01.2011 09:53, schrieb David Hein:
>>>> Hello everyone,
>>>>
>>>> i've got some problems with the ocl queries. I want to do a query like
>>>> this:
>>>>
>>>> CDOQuery oclQuery = cdoTransaction.createQuery("ocl",
>>>> "StringValue.allInstances()", TypesPackage.eINSTANCE.getStringValue());
>>>>
>>>> StringValue is a class in my EMF model. The Server print the following
>>>> exception:
>>>>
>>>> !MESSAGE Evaluation failed with an exception: Object OID2211 not found
>>>> in branch 0 at *
>>>> !STACK 0
>>>> org.eclipse.emf.cdo.util.ObjectNotFoundException: Object OID2211 not
>>>> found in branch 0 at *
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.createObje ct(AbstractCDOView.java:808)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:712)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:664)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.view.AbstractCDOView.getObject( AbstractCDOView.java:1)
>>>>
>>>>
>>>> ...
>>>>
>>>> If I query other classes in my model it works fine. A simple sql query
>>>> statement like "Select * From StringValue" works also fine.
>>>>
>>>> Thanks!
>>>> David
>>
>


Previous Topic:[Teneo] Delete orphans in non-contaiment references
Next Topic:[EMF] Import a Rose model into a ecore model
Goto Forum:
  


Current Time: Thu Apr 25 09:53:28 GMT 2024

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

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

Back to the top