-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgres: getting an actual stream out of NamedParameterJdbcTemplate. #34648
Comments
Have you tried |
|
I did. No difference |
To enable the behaviour on raw JDBC I just had to call I'd appreciate some guidance on how to do this. The first problem I see is that Spring's JdbcTemplate seems to get its own connection from the data source, so I don't have a chance to change auto commit on the connection. |
I'm pretty sure it's controlled by |
@quaff, you were in the end right. Setting the However, simply setting the You need to create the
Closing the issue and thanks to everyone. |
I'm using Postgres and I have a query whose result set is so large that does not fit into memory. When I call NamedParameterJdbcTemplate.queryForStream I get an out of memory error because the method attempts to read the whole result set before creating a stream based on the in-memory result.
Is there a way to get an actual stream out of the NamedParameterJdbcTemplate? I've managed to get something similar using a JDBC raw connection from Postgres (caveat: you need to disable auto commit for it to work) but in comparison is cumbersome not being able to use all the facilities provided by NamedParameterJdbcTemplate.
The text was updated successfully, but these errors were encountered: