Skip to content

Postgres: getting an actual stream out of NamedParameterJdbcTemplate. #34648

@garca7

Description

@garca7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions