Hi
I'm working on an export query that returns tens of millions of rows and in order to keep the memory usage under control I'm using the fetchStream() method to stream them into a zip file. I found that I also need to set the fetchSize on the settings object to prevent my application (Java EE on Wildfly with Postgres) pulling the entire result set into memory.
I have a single application scoped DSLContext that's being injected across the application and am trying to work out if it's going to be safe to modify the fetchSize on the settings object inside a single transaction. Following the processing I'm setting the fetchSize back to the default value. Other code within the application are using the standard fetch() and are expecting the entire result set to be returned.
I struggled a bit to work out if this is sensible/safe from the documentation or if I should have a separate DSLContext that I create specifically for these requests that need to change the fetchSize.
Thanks
Ryan