Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Extra Lazy Loading problems
[Teneo] Extra Lazy Loading problems [message #546349] Mon, 12 July 2010 14:13
Wolf Fischer is currently offline Wolf Fischer
Messages: 43
Registered: July 2009
Member
Hi there (Hi Martin Wink),

as i have a large containment feature, i want to try the extra lazy loading property. So, first I set the property

props.setProperty(PersistenceOptions.FETCH_ASSOCIATION_EXTRA_LAZY, "true");


When i try to import data into the DB, i get the following exception:
org.hibernate.MappingException: Duplicate property mapping of GuideStylehorizontalGuides found in Guide
    at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:477)
    at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:467)
    at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
    at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
    at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.buildSessionFactory(HbSessionDataStore.java:205)
    at org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initialize(HbSessionDataStore.java:90)
    at brms.helper.StoreController.initializeDataStore(StoreController.java:109)
    at brms.helper.ImportFile2DB.convert(ImportFile2DB.java:47)
    at brm_s.StartUp.main(StartUp.java:46)

The GuideStylehorizontalGuides seems to be a GMF class so i have no real influence on that one. Therefore i tried to annotate just the containment feature which i would actually need the lazy loading feature for with the corresponding attribute (@OneToMany(fetch=EXTRA) ), regenerated the model code and then retried importing my data into the database. However, then i get the following exception:

org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: SyntacticElement
    at org.hibernate.engine.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:242)
    at org.hibernate.type.EntityType.getIdentifier(EntityType.java:430)
    at org.hibernate.type.ManyToOneType.isDirty(ManyToOneType.java:265)
    at org.hibernate.type.TypeFactory.findDirty(TypeFactory.java:619)
    at org.hibernate.persister.entity.AbstractEntityPersister.findDirty(AbstractEntityPersister.java:3141)
    at org.hibernate.event.def.DefaultFlushEntityEventListener.dirtyCheck(DefaultFlushEntityEventListener.java:501)
    at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:227)
    at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:150)
    at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
    at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:49)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
    at org.eclipse.emf.teneo.hibernate.HbSessionWrapper.flush(HbSessionWrapper.java:171)
    at org.eclipse.emf.teneo.hibernate.resource.HibernateResource.saveResource(HibernateResource.java:373)
    at org.eclipse.emf.teneo.resource.StoreResource.save(StoreResource.java:405)
    at brms.helper.ModelUtils.saveDBResource(ModelUtils.java:235)
    at brm_s.StartUp.main(StartUp.java:54)


So I know that this element is not yet saved within the database, as i want to save the complete result at the end of the process. Which options do I have, to solve this problem? The SyntacticElement is one of the types that is part of this containment feature.

Thanks in advance!

Wolf
Previous Topic:[CDO] Profiling CDO
Next Topic:Migrating to Delegates (Helios)
Goto Forum:
  


Current Time: Mon Oct 20 22:59:26 GMT 2014

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

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