JPA Custom Repository Stream JDBC Exception with JOIN FETCH
I have a custom JPA Repository that returns a stream. The custom jpa call has a few left joins with with code root.fetch(“variable”, JoinType.Left). When calling the foreach loop on the stream I receive a JDBC error “Could not determine if resultsset is empty due to exception calling isBeforeFirst or isAfterLast” also “This method should only be called on resultset objects are are scrollable type TYPE_SCROLL_SENSITIVE or TYPE_SCROLL_INSENSITIVE”. I have tried to add the @Transactional annotation to the method which doesn’t work. If a update the code to be root.join(“variable”, JoinType.Left) the code works as expected. However, I would love to keep the root.fetch instead of root.join for performance reasons. Any suggestions to how to get around this issue?