[Biojava-dev] [Bug 2510] New: Error when trying to retrieve a sequence assigned to a feature from BioSQL using Hibernate

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Jun 6 06:54:03 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2510

           Summary: Error when trying to retrieve a sequence assigned to a
                    feature from BioSQL using Hibernate
           Product: BioJava
           Version: live (CVS source)
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DB / BioSQL
        AssignedTo: biojava-dev at biojava.org
        ReportedBy: andreas.draeger at uni-tuebingen.de


Hibernate throws an exception, which occurs inside setter of
org.biojavax.bio.seq.SimpleRichFeature.locationSet when trying to execute the
following piece of code:

Transaction tx = session.beginTransaction();
Query q1 = session.createQuery(
  "from Feature as f " +
  "inner join fetch f.noteSet as n " +
  "where n.value=:val and f.typeTerm.name=:term");
q1.setString("val","TRNF");
q1.setString("term","gene"); 
List<SimpleRichFeature> li = q1.list();
for (Iterator<SimpleRichFeature> i = li.iterator(); i.hasNext(); ){
  SimpleRichFeature f = i.next();
  System.out.println(f.getSequence().seqString());
}
tx.commit();
session.close();

==================

The exception reads:


Exception in thread "main" org.hibernate.PropertyAccessException: Exception
occurred inside setter of org.biojavax.bio.seq.SimpleRichFeature.locationSet
   at
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65)
   at
org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
   at
org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
   at
org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3571)
   at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:133)
   at
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
   at org.hibernate.loader.Loader.doQuery(Loader.java:729)
   at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
   at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
   at
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
   at
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
   at
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:63)
   at
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
   at
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
   at
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:844)
   at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
   at org.hibernate.loader.Loader.loadEntity(Loader.java:1860)
   at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
   at
org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
   at
org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3049)
   at
org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:399)
   at
org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:375)
   at
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:139)
   at
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:98)
   at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
   at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:836)
   at
org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
   at
org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
   at
org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)
   at
org.biojavax.bio.seq.ThinRichSequence$$EnhancerByCGLIB$$e3c3c7ff.seqString(<generated>)
   at meinVersuch.TestAbfragen.main(TestAbfragen.java:59)
Caused by: java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at
org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
   ... 30 more
Caused by: java.lang.RuntimeException: Error while trying to call new class
org.biojavax.ontology.SimpleComparableOntology(class java.lang.String)
   at
org.biojavax.bio.db.biosql.BioSQLRichObjectBuilder.buildObject(BioSQLRichObjectBuilder.java:166)
   at org.biojavax.RichObjectFactory.getObject(RichObjectFactory.java:105)
   at
org.biojavax.RichObjectFactory.getDefaultOntology(RichObjectFactory.java:221)
   at
org.biojavax.bio.seq.CompoundRichLocation.getJoinTerm(CompoundRichLocation.java:61)
   at
org.biojavax.bio.seq.CompoundRichLocation.<init>(CompoundRichLocation.java:90)
   at
org.biojavax.bio.seq.SimpleRichLocation.union(SimpleRichLocation.java:494)
   at org.biojavax.bio.seq.RichLocation$Tools.merge(RichLocation.java:363)
   at
org.biojavax.bio.seq.SimpleRichFeature.setLocationSet(SimpleRichFeature.java:181)
   ... 35 more
Caused by: java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at
org.biojavax.bio.db.biosql.BioSQLRichObjectBuilder.buildObject(BioSQLRichObjectBuilder.java:133)
   ... 42 more
Caused by: org.hibernate.HibernateException: A collection with
cascade="all-delete-orphan" was no longer referenced by the owning entity
instance: Feature.locationSet
   at
org.hibernate.engine.Collections.processDereferencedCollection(Collections.java:96)
   at
org.hibernate.engine.Collections.processUnreachableCollection(Collections.java:39)
   at
org.hibernate.event.def.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:218)
   at
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:77)
   at
org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
   at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
   ... 47 more


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the biojava-dev mailing list