Prefetch Path Element at Index 0 isn't a subtype

Posts   
 
    
Kodiak
User
Posts: 92
Joined: 13-Apr-2009
# Posted on: 06-Nov-2019 05:12:40   

Hi Guys,

This was previously working and just started breaking for some reason (database and code for this is unchanged).

The prefetch path element at index 0 in the passed in prefetch path for root entity type 157 is meant for root entity type 160 which isn't a subtype of 157. This means that you've added a prefetch path node to a Path of an unrelated entity, for example adding OrderDetailsEntity.PrefetchPathProduct to a prefetch path for CustomerEntity. at SD.LLBLGen.Pro.ORMSupportClasses.PrefetchPathFetcher.ProducePathNodeParameters

var digitalReceipt = new DigitalReceiptEntity(digitalReceiptId);
            var prefetch = new PrefetchPath2(EntityType.DigitalReceiptEntity)
            {
                DigitalReceiptEntity.PrefetchPathDigitalOrder,
                DigitalReceiptEntity.PrefetchPathCardTypeCode,
                DigitalReceiptEntity.PrefetchPathAcquirersResponseCode,
                DigitalReceiptEntity.PrefetchPathTransactionResponseCode
            };

            Adapter.FetchEntity(digitalReceipt, prefetch);

This correctly maps the relationships - a Receipt links to a Order, Card Type, Response etc.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 06-Nov-2019 09:05:28   

If nothing changed at all, things don't break, so something must have changed. That or it's used in a multi-threaded call path where 2 or more threads are now altering the same prefetch path object (they can't be shared among threads).

Is that the case perhaps? Can you reliably reproduce it every time or is it occurring randomly at times?

In your app, if you do: var e = ((EntityType)157).ToString();

what is 'e'? Same for 160.

Frans Bouma | Lead developer LLBLGen Pro
Kodiak
User
Posts: 92
Joined: 13-Apr-2009
# Posted on: 06-Nov-2019 11:02:38   

Hi Frans,

I rebuilt and redployed all DLLs and the other non-LLBL Gen libraries that were fetching the entity and everything worked again.

Doesn't make sense but it is working...