scrollableresults « Query « JPA Q&A





1. Hibernate ScrollableResults Do Not Return The Whole Set of Results    stackoverflow.com

Some of the queries we run have 100'000+ results and it takes forever to load them and then send them to the client. So I'm using ScrollableResults to have a paged ...

2. Count of the result of a Hibernate Criteria group by - total grouped records returned    stackoverflow.com

I have a Criteria-based query with the following grouping:

Projections.projectionList()
    .add(Property.forName("xyz").group()));
The SQL generated is (proprietary, so cleansed):
select this_.XYZ as y0_ from FOO.BAR this_ WHERE [long where clause] 
  ...

3. ScrollableResults yields to OutOfMemory error    forum.hibernate.org

Hi. I'm trying to index a complex entity from a table with approx. 100000 Entries. But after some (maybe 400) entries I got an out of memory error. Clearing the session or evicting the current object doesn't solve the problem. The Hibernate Version is 3.2.6 and the Database is Sybase Anywhere 9.0.2. Any ideas would be helpful. Regards Bernd public void ...

4. ScrollableResults returns the same row again and again    forum.hibernate.org

Hi All, I'm using Hibernate in a JAX-WS/Spring Web Application running inside of Weblogic. I'm using Hibernate to pull about several thousand rows from the database using ScrollableResults and I'm seeing some oddities with Hibernate. What seems to be happening is...I can make one request and Hibernate returns the proper resultset. If I make the same exact request again, Hibernate takes ...

5. ScrollableResults does not work with manyvalued associations    forum.hibernate.org

We are using the following query with ScrollableResults: "SELECT o FROM Order o left outer join fetch o.orderLines ol " + "WHERE o.nextShipDate <= :nsd ORDER BY o.nextShipDate"; In other words the Order has a list of orderLines that we eagerly fetch, from the Query we get the cursor: ScrollableResults itemCursor = query.scroll(ScrollMode.SCROLL_INSENSITIVE); and then we iterate over the cursor to ...

6. Native query, ScrollableResults and transformers    forum.hibernate.org

Hi all, I find myself in the following scenario: we're porting a legacy system to J2EE and we choose to use JPA + HIBERNATE. The legacy system had a persistence mechanism based on objects so it was quite simple to translate most of the database interaction to @Entity class. In some cases, it happened that sql queries were issued to load ...

7. ScrollableResults and large result set    forum.hibernate.org

Hi, I am using Hibernate 2.1 and Oralce 9. I am using a query that may return a very large result set. I dont want to use list() because this would eat up my memory. I also dont want to use iterate(), beacuse this would do a select for every single object that i use and I am actually reading all ...

8. no ScrollableResults.setRowNumber found    forum.hibernate.org

9. Problems with offset in ScrollableResults    forum.hibernate.org

Hi, I read out pages of a ResultSet like this: ScrollableResults sr = Interessent.getScrollableRS(); try { sr.beforeFirst(); System.out.println("rownumber: "+sr.getRowNumber()); sr.setRowNumber(offset); System.out.println("rownumber: "+sr.getRowNumber()); for (int i = 0; i < pageSize; i++){ Object[] inhalt = sr.get(); System.out.println("inhalt: "+inhalt[0]+" "+inhalt[1]+" "+inhalt[2]+" "+inhalt[3]+" "+inhalt[4]+" "+inhalt[5]+" "+inhalt[6]+" "+inhalt[7]); int k = 0; ergebnisListe.add(new SuchErgebnisInteressenten((String) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++], (Calendar) inhalt[k++], (String) inhalt[k++], (String) inhalt[k++], ...





10. scrollableResults, full text indexes and createSQLQuery    forum.hibernate.org

tools Hibernate 2.1.1 SQL SERVER database I am trying to build a search engine for my database, and am using a full text index with a contains clause. I am putting the results in a scrollableResult so that i can display the results 20 per page. With this code: ScrollableResults sr = null; try { Session session = HibernateSession.getSession(); if (className ...

12. ScrollableResults    forum.hibernate.org

Hibernate version: 2.1.6 Name and version of the database you are using: SQLServer2000 ( jTDSDriver ) I have a problem when trying to select all rows from a large table ( 1.5 million rows ). Doing a simple find( "from MyObject" ) seems will run into garbage collection problems as the combined temporary overhead of hibernate and the JDBC driver uses ...

13. ScrollableResults    forum.hibernate.org

Hibernate version: 2.1.6 Name and version of the database you are using: SQLServer 2000 + jtds I've been playing around with the ScrollableResults and I had a few performance issues with it. The problem I have is that sometimes I need to select a very large number of rows out of the database and using find() or a Query often results ...

15. ScrollableResults and Criteria doesn't work in 3.0.5    forum.hibernate.org

public void testScroll() { Session session = openSession(); Transaction t = session.beginTransaction(); Course course = new Course(); course.setCourseCode("HIB"); course.setDescription("Hibernate Training"); session.persist(course); Criteria c = session.createCriteria(Course.class); ScrollableResults src = c.scroll(); session.delete(course); t.commit(); session.close(); }

16. NPE with ScrollableResults use, after 3.0.5 migration    forum.hibernate.org

Regular Joined: Fri Nov 07, 2003 6:31 am Posts: 104 Location: Beijing, China After migration to 3.0.5 I've got my only method using query.scroll() that fails, giving an NPE: It was working well before and I don't see any error in the HQL. stacktrace: Code: java.lang.NullPointerException: null at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:264) at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3022) at ...





17. Pagination: ScrollableResults vs Criteria (record count)    forum.hibernate.org

Hello I am using Orcacle database. I am trying to write some pagination functionlity. Where i can get the total number of records + selecet records page by page. I been searching through the post and found that it can be done both ways 1) ScrollableResults: ScrollableResults people = query.scroll(); people.last(); totalResults = people.getRowNumber() + 1; setRowNumber(initialRow); scroll(maxNbRows); 2) Criteria criteria.setFirstResult( ...

18. ScrollableResults: problem with dirty check    forum.hibernate.org

the problem is that a ScrollableResults.next() already loads the object into the session and not ScrollableResults.get(); so this, for instance, does not work (in my case): public class ScrollableResultSetWrapper implements Enumeration { private ScrollableResults results; private boolean more = false; private boolean closed = true; public ScrollableResultSetWrapper(ScrollableResults results) { this.results = results; this.more = results.next(); // init this.closed = false; } ...

19. Problems with ScrollableResults    forum.hibernate.org

When I use ScrollableResults on SQL queries (select a,b,c,d from sometable) I always get ArrayIndexOutOfBoundsExceptions when I use getInteger(i) etc., because the internal Type[] which represents the column types of the result is empty. What have I to do, to make these operation work? When i use get() and cast the columns myself I got no problems. Or do these operations ...

20. ScrollableResults OutOfMemoryError as soon as I touch it.    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1 Mapping documents: Code: ...

21. scrollableresults metadata    forum.hibernate.org

22. Non-performant ScrollableResults    forum.hibernate.org

Hibernate version: 3.2.2 Database version: Oracle 9.2.0.6.0 64bit Generated SQL: select loanimpl0_.as_of_date as as1_2_, loanimpl0_.id_number as id2_2_, loanimpl0_.gl_account_id as gl3_2_ from loans loanimpl0_ where loanimpl0_.as_of_date=? Mapping file:

23. scrollableResults - scroll() returns no results    forum.hibernate.org

24. scrollableResults - scroll() returns no results    forum.hibernate.org

25. Possible Bug. ScrollableResults close() throws exception    forum.hibernate.org

HibernateEntityManager emSybase = (HibernateEntityManager) hibEmfSybase.createEntityManager(); HibernateEntityManager emMysql = (HibernateEntityManager) hibEmfMysql.createEntityManager(); ScrollableResults sr = emSybase.getSession() ...

26. How to renew ScrollableResults?    forum.hibernate.org

27. ScrollableResults - OutOfMemory - Doesn't appear to scroll    forum.hibernate.org

Newbie Joined: Tue Aug 26, 2003 2:31 pm Posts: 15 Location: San Diego, CA Hibernate version: 3.3.0.cr1 Name and version of the database you are using: MySQL 5.0.42 The problem I seem to be having is that the scrollableresults are not querying the database using limits. My resultset to be returned will be huge. I'm trying to use the scrollableresults as ...

28. ScrollableResults and DISTINCT_ROOT_ENTITY    forum.hibernate.org

For example I have the following pojo: Contact with a relation one to many with Telephone. So I want to use the ScrollableResults. If i have 1 contact with 3 phone numbers, in my ScrollableResults i have 3 records. So if i apply the DISTINCT_ROOT_ENTITY on the ScrollableResults, always 3 results. Normal I think. But i would like know if it ...

29. Stubing/Mocking ScrollableResults    forum.hibernate.org

Hi Im unit testing one of my service classes and because of nature of unit tests I have to mock all of its collaborators. One of collaborators is dao object with method returning ScrollableResults. I want to stub this dao method to always return expected value. I found that all implementations of ScrollableResults interface works with JDBC API (ResultSet etc) so ...

30. ScrollableResults    forum.hibernate.org

return logReadOnlySession.createQuery( "from AuditLog as agentLog" + " where agentLog.timestamp" + " between :startTime and :endTime" + " order by agentLog.userID") .setLong("startTime", summary.getStartTime()) .setLong("endTime", summary.getEndTime()) .setCacheMode(CacheMode.IGNORE) .setFetchSize(AUDIT_LOGS_FETCH_SIZE) .scroll(ScrollMode.FORWARD_ONLY);

31. ScrollableResults    forum.hibernate.org

return logReadOnlySession.createQuery( "from AuditLog as agentLog" + " where agentLog.timestamp" + " between :startTime and :endTime" + " order by agentLog.userID") .setLong("startTime", summary.getStartTime()) .setLong("endTime", summary.getEndTime()) .setCacheMode(CacheMode.IGNORE) .setFetchSize(AUDIT_LOGS_FETCH_SIZE) .scroll(ScrollMode.FORWARD_ONLY);

32. ScrollableResults problem with very large database    forum.hibernate.org

Hi, I am trying to load a list with ScrollableResult and that works fine if there are not a lot of results. But now i have like 1.5milj titles and i get this exception while calling query.scroll I appreciate any kind of help thx in advance Hibernate version: hibernate-annotations Code between sessionFactory.openSession() and session.close(): @Transactional(readOnly = true) public SrollableResults load(Distributor dis){ ...

33. ScrollableResults perf question    forum.hibernate.org

Hi, All, To deal with a large result set(0.5~1M), I used this code fragment: ============================ Query query = getSession().createQuery("select p.lastName, p.firstName from Person as p where p.age= :age"); query.setLong("age", 21); ScrollableResults res = query.scroll(ScrollMode.FORWARD_ONLY); count = 0; while (res.next()) { String lName= res.getString(0); String fName= res.getString(1); //TODO biz logic starts here count++ // clear cache to avoid memory issue if ( ...