spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

Add note about driver behaviour for streaming query results [DATAJPA-1007]

Open spring-projects-issues opened this issue 8 years ago • 2 comments

Robert Hunt opened DATAJPA-1007 and commented

It would be useful to add a note about JDBC driver behaviour in relation to streaming results. I know it goes beyond the scope/control of Spring Data but someone might assume that by using a Stream return type that the ResultSet is being fetched in a streaming nature from the database.

In the case of MySQL this is certainly not the case as a @QueryHint needs to be included as a signal to the underlying driver (see: http://knes1.github.io/blog/2015/2015-10-19-streaming-mysql-results-using-java8-streams-and-spring-data.html)

Just a small note as a hint to the reader that they may need to investigate the behaviour of their specific drivers in regard to memory-efficient fetching would be useful


Reference URL: http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.query-streaming

spring-projects-issues avatar Nov 18 '16 13:11 spring-projects-issues