Questions tagged [scrollableresults]

A result iterator that allows moving around within a Query results by arbitrary increments. sultSet.

A result iterator that allows moving around within a query results by arbitrary increments.

The Query / ScrollableResults pattern is very similar to the JDBC PreparedStatement/ ResultSet pattern and the semantics of methods of this interface are similar to the similarly named methods on ResultSet.

34 questions
1
vote
1 answer

Need to get the type of the column using ScrollableResults in Hibernate

I am generating a report using Hibernate. Below is the sample code: Query query = session.createSQLQuery("select * from A, B where A.id= B.Val"); ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY); I want to know all the column names…
Karthik
  • 11
  • 1
1
vote
0 answers

How to get the total of lines of a search with just one "select" in Hibernate using setFetchSize() and without scroll() all the rows? Is it possible?

First, I'm using Java and Hibernate (with setFech() method and ScrollableResults class). Second, I'm working with a table that has dozen of millions of rows and more than one hundred of columns. And this table joins with other two. So a simple…
Marcel
  • 2,810
  • 2
  • 26
  • 46
1
vote
2 answers

ScrollableResultSet.next() gradually slows down when using Session.save() whilst scrolling

I am using a ScrollableResults object to scroll through about 500,000 to 1,000,000 rows from a table. Whilst scrolling I create a different entity using the resulting entity from each iteration and use session.save() to persist this object. Below is…
MattLBeck
  • 5,701
  • 7
  • 40
  • 56
1
vote
2 answers

can not use resultSet.setFetchDirection(ResultSet.TYPE_SCROLL_SENSITIVE) with spring jdbc DaoSupport with Oracle

I want to use scrollable resultset, so when I use two lines of code: rs.setFetchDirection(ResultSet.TYPE_SCROLL_SENSITIVE); rs.absolute(12); in my DAOimpl, I get exception, plz help to solve them, thank in advance. import…
m0z4rt
  • 1,055
  • 2
  • 17
  • 25
1
vote
1 answer

Hibernate ScrollableResults via HQL requires left join fetch for every association

Hopefully some Hibernate guru can help out. I have an object structure that looks like this: class Customer { private Stuff1 stuff1; private Stuff2 stuff2; // Bazillion other fields } class Report { private Customer customer; …
3martini
  • 510
  • 2
  • 13
1
vote
3 answers

Advice on JDBC ResultSet

I have Employee table and an Entity class for it, My task is such that i need the data of employee table within result set(of type scrollable) two times, in such case what would be better of the following for using the data second time -> 1: create…
Ravi Jain
  • 1,452
  • 2
  • 17
  • 41
0
votes
1 answer

Hibernate performance issue: ScrollableResults vs firstResult/maxResult

As you see the title, I would be glad to hear your answers about which one is more convenient for performance as SELECTing huge data from db! Which is the best to prefer for which cases and why? (PS: There is not any mapping relation like…
javatar
  • 4,542
  • 14
  • 50
  • 67
0
votes
2 answers

Count of the result of a Hibernate Criteria group by - total grouped records returned

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…
Software Prophets
  • 2,838
  • 3
  • 21
  • 21
0
votes
2 answers

How to use ScrollableResults for Hibernate Queries when joining many different entities

I am using Spring Boot endpoints to return results from database queries. It works fine when using getResultList() on the TypedQuery. However I know I will have to managed very large data sets. I am looking into using ScrollableResults via hibernate…
Ryan
  • 61
  • 6
0
votes
1 answer

How to check Scrollable interface is empty?

Returning from a hql query, how to check if a ScrollableResults object is empty? scrollable.first?
BicaBicudo
  • 307
  • 1
  • 8
  • 20
0
votes
0 answers

Duplicate Entities in ScrollableResults Set

I am fetching data from a large table (~1 million entries) with hibernate via scrollable resultset. The issue I am facing now is very strange and right now I don't seem to find the answer. What I do is load the data with a pretty simple statement,…
m0rb
  • 63
  • 10
0
votes
1 answer

Hibernate - best pagination method

I'm working on a website where I have to show news vertically (one after another). Let's says I have like 100 news and I want to show 10 by 10 just by scrolling. I don't want to remove the first 10 news I've shown, just keep scrolling and adding…
Demian
  • 390
  • 3
  • 8
  • 15
0
votes
0 answers

Eclipselink ScrollableCursor fails on second next() call

I am trying to use ScrollableCursor for loading all users of the system to memory. I have a code like this: Query findUsersQuery = entityManager.createNamedQuery(UserEntity.QUERY_ALL_USERS, UserEntity.class); …
Architect
  • 155
  • 2
  • 11
0
votes
1 answer

Using ScrollableResults and hibernate

It's my first time trying this, but I'm getting the following error: The result set is closed while trying to use ScrollableResults. @Override public void associarTodosConteudos(LoteTransferenciaTO lotetransferencia, UsuarioDepartamentoTO…
Johnny Santana
  • 157
  • 1
  • 3
  • 15
0
votes
1 answer

Hibernate ScrollableResultSet unexpected OutOfMemoryError

I have Postgres DB, 7500 rows in Client table, -Xmx8m. Query query = session.createQuery("select c from Client c"); ScrollableResults resultSet = query.setFetchSize(50).setCacheMode(CacheMode.IGNORE) .scroll(ScrollMode.FORWARD_ONLY); int i =…
idmitriev
  • 4,619
  • 4
  • 28
  • 44