StatelessSession « Fetch « JPA Q&A





1. StatelessSession and eager fetching    forum.hibernate.org

I just started using StatelessSessions in Hibernate 3.1 and immediately ran into problems with non-lazy entities. What I am trying to do is run a simple Criteria query on a table, which mapping has lazy="false". The query retrieves all the rows from the table and I print them out as they are being retrieved. This process crashes all the time if ...

3. StatelessSession getting a "collections cannot be fetch    forum.hibernate.org

Hi, I'm trying to create new DAOs using hibernate stateless sessions due to integration requirements and for particular retrieve methods I consistently run into the hibernate exception: "org.springframework.orm.hibernate3.HibernateSystemException: collections cannot be fetched by a stateless session". I've been following the stateless session example from the hibernate docs--http://www.hibernate.org/hib_docs/v3/reference/en/html/batch.html--using Scrollable results with no success. Here is a snippet of the retrieval method in ...

4. Fetch joins, proxies and StatelessSession    forum.hibernate.org

Hi! My case is as follows: We're using stateless Hibernate session to query large number of objects of type A together with their related objects (1-1 relations, but that's not essential). So my HQL looks more-less like this: SELECT t1, t2, t3 FROM Type_A t1 LEFT JOIN FETCH t1.relation1 t2 LEFT JOIN FETCH t1.relation2 t3 The SQL generated looks OK, three ...

5. Eager fetching with Criteria queries and StatelessSession    forum.hibernate.org

Hi, I'm currently evaluating to use Hibernate for stateless, criteria-query only fetching of object-records. I want to specify which associations are to be fetched beforehand instead of using lazy loading. StatelessSession and Criteria fits my needs so far. I'm using criteria.setFetchMode("association", FetchMode.JOIN) to get the associations eagerly-fetched. But I'm wondering: Is a JOIN in all cases the best/correct way to fetch ...