I have a JOOQ query where I want to avoid materializing all Records at the same time. (However, I am fine with jointly materializing all bean objects created from them.)
I have the following simple method to load the data:
public List<CustomerInfo> getCustomers() {
return dslContext
.selectFrom(CUSTOMER)
// <-- note the missing .fetch()
.stream()
.map(CustomerInfo::new)
.collect(Collectors.toList());
}
Can this lead to a JDBC connection leak in any circumstances? (e.g. an Exception in CustomerInfo::new
)