-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: cannot simultaneously fetch multiple bags
PostPosted: Tue Jun 26, 2007 3:21 am 
Newbie

Joined: Tue Feb 20, 2007 12:50 am
Posts: 2
hi all

just downloaded hibernate 3.2.4.sp1 core, and annotations 3.3.0 ga
i'm not sure which versions they're upgrading from, both definitely version 3+ (from april 2006)

i'm now getting this error (multiple bags) on one of the applications i'm working on, and i really don't understand the problem
i've looked at another post with the same error, but i don't think the code is similar
http://forum.hibernate.org/viewtopic.php?p=2310316&

Code:
@SuppressWarnings("unchecked")
    public static Collection<Category> getPrimaryCategories() {
       
        Session s = HibernateUtil.getInstance().getSession(Category.class);
        Criteria crit = s.createCriteria(Category.class);
        crit.add(Restrictions.isNull("parent"));
        Collection<Category> results = crit.list();
           
        return results;
    }


Code:
Stack Trace:

    * org.hibernate.loader.BasicLoader.postInstantiate(BasicLoader.java:66)
    * org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:75)
    * org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:43)
    * org.hibernate.loader.entity.EntityLoader.<init>(EntityLoader.java:33)
    * org.hibernate.loader.entity.BatchingEntityLoader.createBatchingEntityLoader(BatchingEntityLoader.java:103)
    * org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1748)
    * org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:1752)
    * org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:2984)
    * org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:2977)
    * org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:690)
    * org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:290)
    * org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
    * org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
    * package.persistence.HibernateUtil.createSessionFactory(HibernateUtil.java:314)
    * package.persistence.HibernateUtil.getSession(HibernateUtil.java:173)
    * package.persistence.HibernateUtil.getSession(HibernateUtil.java:137)
    * package.model.Category.getPrimaryCategories(Category.java:169)


using mssql server 2000

this is basically happening anywhere i am using the Session object
this code is inherited, so i only maintain it really

i don't use it at all in another app i am developing, and i haven't seen any errors there

can anyone point me in the direction of a solution?
cos right now, it might be easier to simply roll back to the version i was using before (preferably not though, especially if this is an issue in our code).

any advice
thanks
dave


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.