PrefetchPath Predicate: Avoiding SQL's "The incoming request has too many parameters"

Posts   
 
    
trancehead
User
Posts: 137
Joined: 03-Dec-2007
# Posted on: 15-Sep-2017 08:01:17   

I have a prefetch path predicate that is filtering the prefetch on a list of related ids.

Structure: Batch Table <- 1..m -> Transaction Table

When I fetch the batch, I only want a subset of the transactions to be included in the prefetch. This has worked well up until this point but today I had a list of transactions that exceeded the 2,300 IN clause limit for SQL.

if (transactionIdsToIncludeInPrefetch != null && transactionIdsToIncludeInPrefetch.Any())
    prefetchFilter.Add(TransactionFields.Id == transactionIdsToIncludeInPrefetch);

prefetchPath.Add(BatchEntity.PrefetchPathTramsactions, 0, prefetchFilter)

Is there a way to do this?

With a normal filter, I page the list and submit multiple database requests so that it always uses less than 2,300 list items. I don't think I can do that with a prefetch, can I?

LLBLGen Pro version + buildnr: 4.2 August 2nd 2015 Adapter Templates

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 15-Sep-2017 09:46:43