1

Hibernateの使用に問題があります。クエリのいずれかを実行した後、次のログメッセージが表示され、プログラムが動作を停止します。

20:36:48,805 TRACE ThreadLocalSessionContext:344 - allowing proxied method [createQuery] to proceed to real session
4608 [main] TRACE org.hibernate.context.ThreadLocalSessionContext  - allowing proxied method [createQuery] to proceed to real session
20:36:48,806 TRACE QueryPlanCache:128 - located HQL query plan in cache (from Propertylist where typedlistId = ?)
4609 [main] TRACE org.hibernate.engine.query.QueryPlanCache  - located HQL query plan in cache (from Propertylist where typedlistId = ?)

実際には、私が呼び出す小さなメソッドがあります:

public List<Zielobjekt> gibZielobjekte() {
    List<Zielobjekt> zielobjekte = new ArrayList<Zielobjekt>();

    Session session = _sessionFactory.getCurrentSession();
    session.beginTransaction();

    for(Informationsverbund iv : gibInformationsverbuende() /*Behind this method is a Hibernate query, it works fine.*/ )
    {
        Set<Celement> zobjekte = gibBaumelementeFuerVater(session, iv.getOriginalId());

        LOGGER.info("Insgesamt " + zobjekte.size() + " ZO gefunden.");

        for(Celement element : zobjekte)
        {
            Set<Propertylist> eigenschaften = gibEigenschaftsliste(session, element); /*Behind this Method is a Hibernate Query, here the Program stops to work.*/          
            //HERE THE PROGRAM STOPS WORKING
            ... 
        }

    }

    session.getTransaction().commit();

    return zielobjekte;
}

プログラムが動作を停止する、呼び出されるメソッドは次のとおりです。

private Set<Propertylist> gibEigenschaftsliste(Session session, Celement element)
{
    try
    {
        return new HashSet(session.createQuery(
                "from Propertylist where typedlistId = ?")
                .setInteger(0, element.getEntityId())
                .list());
    }
    catch (HibernateException e)
    {
        e.printStackTrace();
        return null;
    }
}
4

0 に答える 0