Thank you for the responses, sir. I had one query where I ran it over and over again, but then after about 7-8 times, it was suddenly hanging. Perhaps I am doing something wrong with the queries.
I have this query here (touched up to remove sensitive data) that retrieves results in about 129ms
select * from listing where customer_name = 'CUSTOMER' and list_key like 'abc%' and
status in ("A","B","C","D")
So, with JINQ I attempt to write this as follows, but it hangs indefinitely ...
JinqJPAStreamProvider jpa = new JinqJPAStreamProvider(emf);
JPAJinqStream<Listing> ls = jpa.streamAll(emf.createEntityManager(), Listing.class);
String statuses = "A,B,C,D"
List<String> statusesList = Arrays.asList(statuses.get().split(","));
List<Listing> listingSearchResults = ls.where(l -> l.getCustomerName().equals("CUSTOMER") &&
l.getListKey().startsWith("abc") &&
JPQL.isInList(l.getStatus(), statusesList)).toList();
There were other queries that ran fine most of the time, but then sometimes did not. That seemed to improve when I was closing the JinqStream manually, so I figured it was some open or hung connection.
Probably the most amazing benefit of JINQ over JPA would be in conditionally adding conditions. So for the above, I would have
ls = ls.where(l -> l.getCustomerName().equals("CUSTOMER"));
and then based on conditional logic
if (statuses != null) {
List<String> statusesList = Arrays.asList(statuses.get().split(","));
ls = ls.where(l -> l.JPQL.isInList(l.getStatus(), statusesList)