mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-21 05:21:01 +00:00
#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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user