FetchEntityCollection and supply hints to SQL Server

Posts   
 
    
yowl
User
Posts: 276
Joined: 11-Feb-2008
# Posted on: 19-Dec-2025 17:10:48   

Hi,

How can I get a NOLOCK hint on the root entity (LLBLGen 5.12)

                var prefetchPath = new PrefetchPath2(EntityType.ClaimViewEntity);
                var miClaimPP = prefetchPath.Add(ClaimViewEntity.PrefetchPathMiClaimView).WithHint("NOLOCK");

This will add NOLOCK to the MiClaimView entity, but how do I get the hint on the ClaimViewEntity, it is only possible if I start with a QueryFactory ?

Thanks,

Otis avatar
Otis
LLBLGen Pro Team
Posts: 40026
Joined: 17-Aug-2003
# Posted on: 21-Dec-2025 08:41:34   

Yes, you have to specify the hint on the main query. With a prefetch path, the sub-path nodes are the only place to specify the hint for that additional query as the node represents the additional query.

Frans Bouma | Lead developer LLBLGen Pro
yowl
User
Posts: 276
Joined: 11-Feb-2008
# Posted on: 22-Dec-2025 14:37:56   

Thanks, that's great.