#3412 Use existing/parent transaction with fetch query on ToMany paths

Fix such that LoadManyRequest uses the parent requests transaction rather
than obtain a new read only transaction to perform the fetch query.
This commit is contained in:
Rob Bygrave
2024-06-07 22:16:02 +12:00
parent d817dcb549
commit 3ce95c34cb
@@ -94,6 +94,7 @@ public final class LoadManyRequest extends LoadRequest {
public SpiQuery<?> createQuery(SpiEbeanServer server) {
BeanPropertyAssocMany<?> many = many();
SpiQuery<?> query = many.newQuery(server);
query.usingTransaction(transaction);
String orderBy = many.lazyFetchOrderBy();
if (orderBy != null) {
query.orderBy(orderBy);