Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]
[CDO] [message #1010508] Sun, 17 February 2013 14:11 Go to next message
Stephan Krusche is currently offline Stephan Krusche
Messages: 18
Registered: September 2012
Junior Member
Hi,

I use the CDO Hibernate Store 4.2M5 with MySQL backend. At the very first start of the CDO Client, I create some test data and commit it in one transaction to the empty CDO Server. When I try to access the data afterwards, everything works fine, except for one object "Maintainer", where I get the following exception, when I try to access all objects of this type with a HQL CDOQuery (using a CDOView):

!MESSAGE revision=Maintainer@OID:model/user#Maintainer#4d84fe60-d079-450b-bf06-ed5dbe8d80af:0v1, created=2013-02-17 14:10:00.385, revised=2013-02-17 14:10:00.384
!STACK 0
java.lang.IllegalArgumentException: revision=Maintainer@OID:model/user#Maintainer#4d84fe60-d079-450b-bf06-ed5dbe8d80af:0v1, created=2013-02-17 14:10:00.385, revised=2013-02-17 14:10:00.384
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.setRevised(BaseCDORevision.java:424)
	at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.addRevision(CDORevisionManagerImpl.java:445)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.addToRevisionCache(HibernateStoreAccessor.java:137)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.addToRevisionCache(HibernateQueryHandler.java:276)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.executeQuery(HibernateQueryHandler.java:174)
	at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:294)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
	at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.addRevision(CDORevisionManagerImpl.java:445)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.addToRevisionCache(HibernateStoreAccessor.java:137)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.addToRevisionCache(HibernateQueryHandler.java:276)
	at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.executeQuery(HibernateQueryHandler.java:174)
	at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:294)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)


I don't change the object before I want to access it. Surprisingly the timestamp of "revised" is 1 ms before the timestamp of "created" which seems to cause the exceptions in BaseCDORevision.java:424. For some reason it seems that this is the desired implementation in CDORevisionManagerImpl.java:445

oldRevision.setRevised(revision.getTimeStamp() - 1)


If I try to access all objects of this type again, the error occurs again. But If I restart CDO Server and CDO Client, I can access the "Maintainer" objects without this exception or any other problems.

Any idea why this happens? Is it a bug?

Or could it be a problem with my ecore model (e.g. that I use an attribute / reference name, that is forbidden in the CDOHibernateStore?) The Object "Maintainer" has the following attributes / references within its inheritance chain and is saved in the Person table...

Identifiable (abstract, mapped superclass)
	name : EString
	identifier : EString
	source : EString
	sourceID : EString

Locatable (abstract, mapped superclass) -> Identifiable
	location : Location

Person -> Locatable
	lastName : EString
	firstName : EString
	role : Role
	hashedPassword : EString
	login : EString
	session : Session
	joinedSessions: CollaborativeSession
	contact : Contact
	reviewJobs : MaintananceJobs
	crew : Crew
	currentShift : Shift
	site : Site

Maintainer -> Person
	qualification : GeneralistQualification
	specialization : EString
	available : EBoolean
	licenseValid : EBoolean
	jobDescription : EString
	assignedJobs : MaintenanceJob


I don't have this problem for any other of my 100 objects in my ecore model...
Re: [CDO] [message #1010791 is a reply to message #1010508] Mon, 18 February 2013 08:46 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Stephan,
Hmm, the line of code you refer to is correct, it sets the revised of the previous revision. Do you have auditing
enabled for the hibernate store?
Are there any other specific things with this object. For example do you use manually set id's? And does the object have
the same id(entifier) as another object?

Did you use annotations like MappedSuperclass?

gr. Martin


On 02/17/2013 03:11 PM, Stephan Krusche wrote:
> Hi,
>
> I use the CDO Hibernate Store 4.2M5 with MySQL backend. At the very first start of the CDO Client, I create some test
> data and commit it in one transaction to the empty CDO Server. When I try to access the data afterwards, everything
> works fine, except for one object "Maintainer", where I get the following exception, when I try to access all objects
> of this type with a HQL CDOQuery (using a CDOView):
>
> !MESSAGE revision=Maintainer@OID:model/user#Maintainer#4d84fe60-d079-450b-bf06-ed5dbe8d80af:0v1, created=2013-02-17
> 14:10:00.385, revised=2013-02-17 14:10:00.384
> !STACK 0
> java.lang.IllegalArgumentException:
> revision=Maintainer@OID:model/user#Maintainer#4d84fe60-d079-450b-bf06-ed5dbe8d80af:0v1, created=2013-02-17 14:10:00.385,
> revised=2013-02-17 14:10:00.384
> at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.setRevised(BaseCDORevision.java:424)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.addRevision(CDORevisionManagerImpl.java:445)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.addToRevisionCache(HibernateStoreAccessor.java:137)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.addToRevisionCache(HibernateQueryHandler.java:276)
> at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.executeQuery(HibernateQueryHandler.java:174)
> at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:294)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:680)
> at org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl.addRevision(CDORevisionManagerImpl.java:445)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStoreAccessor.addToRevisionCache(HibernateStoreAccessor.java:137)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.addToRevisionCache(HibernateQueryHandler.java:276)
> at org.eclipse.emf.cdo.server.internal.hibernate.HibernateQueryHandler.executeQuery(HibernateQueryHandler.java:174)
> at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:294)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:680)
>
> I don't change the object before I want to access it. Surprisingly the timestamp of "revised" is 1 ms before the
> timestamp of "created" which seems to cause the exceptions in BaseCDORevision.java:424. For some reason it seems that
> this is the desired implementation in CDORevisionManagerImpl.java:445
>
> oldRevision.setRevised(revision.getTimeStamp() - 1)
>
> If I try to access all objects of this type again, the error occurs again. But If I restart CDO Server and CDO Client, I
> can access the "Maintainer" objects without this exception or any other problems.
>
> Any idea why this happens? Is it a bug?
>
> Or could it be a problem with my ecore model (e.g. that I use an attribute / reference name, that is forbidden in the
> CDOHibernateStore?) The Object "Maintainer" has the following attributes / references within its inheritance chain and
> is saved in the Person table...
>
> Identifiable (abstract, mapped superclass)
> name : EString
> identifier : EString
> source : EString
> sourceID : EString
>
> Locatable (abstract, mapped superclass) -> Identifiable
> location : Location
>
> Person -> Locatable
> lastName : EString
> firstName : EString
> role : Role
> hashedPassword : EString
> login : EString
> session : Session
> joinedSessions: CollaborativeSession
> contact : Contact
> reviewJobs : MaintananceJobs
> crew : Crew
> currentShift : Shift
> site : Site
>
> Maintainer -> Person
> qualification : GeneralistQualification
> specialization : EString
> available : EBoolean
> licenseValid : EBoolean
> jobDescription : EString
> assignedJobs : MaintenanceJob
>
> I don't have this problem for any other of my 100 objects in my ecore model...


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [CDO] [message #1010857 is a reply to message #1010791] Mon, 18 February 2013 10:51 Go to previous messageGo to next message
Stephan Krusche is currently offline Stephan Krusche
Messages: 18
Registered: September 2012
Junior Member
Hi Martin,

here are the answers to your questions:

- Auditing is disabled
- The attribute "identifier" of the abstract class Identifiable is set to "ID" = true and "Unique" = true. This key is also used in "EKeys" as identifying attribute for all relationships between our classes. Each class in our data model inherits from Identifiable
- We set the identifier of all objects when we create them using "UUID.randomUUID().toString()", so there should not be 2 objects in the whole store with the same identifier
- MappedSuperclass is enabled on Locatable and Identfiable (both are in the inheritance chain of Maintainer), but not directly on Maintainer

Why is it necessary to set "the revised of the previous revision" if I just get the object with a read-only CDOView?
I mean if I create an object and read it afterwards without changing it, there should be no need to create a new revision?

In the MySQL database, the two Maintainer objects I access in the CDO client, have version "2". All other objects which were accessed by the same CDO client still have version "1". Could this be a problem?

Best,
Stephan
Re: [CDO] [message #1010863 is a reply to message #1010857] Mon, 18 February 2013 11:07 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5339
Registered: July 2009
Senior Member
Hi Stephan,
Can you try with auditing on? It seems to be an issue if auditing is not enabled...

gr. Martin

On 02/18/2013 11:51 AM, Stephan Krusche wrote:
> Hi Martin,
>
> here are the answers to your questions:
>
> - Auditing is disabled
> - The attribute "identifier" of the abstract class Identifiable is set to "ID" = true and "Unique" = true. This key is
> also used in "EKeys" as identifying attribute for all relationships between our classes. Each class in our data model
> inherits from Identifiable
> - We set the identifier of all objects when we create them using "UUID.randomUUID().toString()", so there should not be
> 2 objects in the whole store with the same identifier
> - MappedSuperclass is enabled on Locatable and Identfiable (both are in the inheritance chain of Maintainer), but not
> directly on Maintainer
>
> Why is it necessary to set "the revised of the previous revision" if I just get the object with a read-only CDOView?
> I mean if I create an object and read it afterwards without changing it, there should be no need to create a new revision?
>
> In the MySQL database, the two Maintainer objects I access in the CDO client, have version "2". All other objects which
> were accessed by the same CDO client still have version "1". Could this be a problem?
>
> Best,
> Stephan


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:Transaction notifications for undo/redo
Next Topic:Why does ECORE exists, when UML was there already?
Goto Forum:
  


Current Time: Thu Oct 23 04:37:36 GMT 2014

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

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