[Biojava-dev] biojavax stress test

mark.schreiber at novartis.com mark.schreiber at novartis.com
Sun Jan 15 21:31:51 EST 2006


>Finally, if I create the RichStreamReader with a null Namespace, letting
>the sequence files provide the namespace, I can retrieve the persisted
>Namespace and BioEntries using hibernate queries, but the BioEntries are
>not associated with the Namespace via the getMembers() method as in the
>biojavax docs.
>
>e.g.
>
>Query query = session.createQuery("from Namespace");
>List namespaces = query.list();
>for (Iterator i = namespaces.iterator(); i.hasNext(); )
>{
>  Namespace namespace = (Namespace) i.next();
>  System.out.println("Namespace: " + namespace.getName());
>
> for (Iterator j = namespace.getMembers().iterator(); j.hasNext(); )
>  {
>    BioEntry bioEntry = (BioEntry) j.next();
>    System.out.println("   BioEntry: " + bioEntry.getName());
>  }
>}
>
>returns
>
>Namespace: MyNamespace
>
>
>whereas
>
>Query query = session.createQuery("from BioEntry");
>List bioEntries = query.list();
>for (Iterator i = bioEntries.iterator(); i.hasNext(); )
>{
>  BioEntry bioEntry = (BioEntry) i.next();
>  System.out.println("BioEntry: " + bioEntry.getName() +
>                     "  Namespace: " + bioEntry.getNamespace());
>}
>
>returns
>
>BioEntry: 12345  Namespace: MyNamespace
>BioEntry: 23456  Namespace: MyNamespace
>...
>
>   michael
>

Seems odd, it looks like Hibernate is not loading the contents of the 
Namespaces on demand. Richard, is this some sort of lazy loading issue?

- Mark




More information about the biojava-dev mailing list