Prefetch path not working

Posts   
 
    
edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 24-May-2009 00:44:02   

I have a table vin_info, with PK Prov, host_txn_number and Sequence. I have a Reg_info table with PK prov and host_txn_number.

Searching vin_info with a serialnumber and prov returns the correct data, but the RegInfo property is null.

Here is my code:


                using (EntityCollection<VinInfoEntity> vins = new EntityCollection<VinInfoEntity>())
                {
                    IRelationPredicateBucket filter = new RelationPredicateBucket();
                    filter.PredicateExpression.Add(VinInfoFields.SerialNumber == vin.Trim());
                    filter.PredicateExpression.Add(VinInfoFields.Prov == prov);

                    IPrefetchPath2 prefetchPath = new PrefetchPath2((int)EntityType.VinInfoEntity);
                    prefetchPath.Add(VinInfoEntity.PrefetchPathRegInfo);

                    adapter.FetchEntityCollection(vins, filter, prefetchPath);
                    if (vins.Count > 0)
                        vinInfo = vins[0];
                }

I have confirmed that it should return one and only one Reg_info record.

Any ideas why this doesn't work?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-May-2009 23:58:51   

The vinInfo.RegInfo property is null, right? - LLBLGen runtime library version (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725)?

  • Are the value at db in different casing? (prov is varchar and is different vin_info and reg_info)
David Elizondo | LLBLGen Support Team
edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 25-May-2009 06:43:24   

daelmo wrote:

The vinInfo.RegInfo property is null, right? - LLBLGen runtime library version (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7725)?

2.6.8.723

  • Are the value at db in different casing? (prov is varchar and is different vin_info and reg_info)

They are both Prov, char(2), not null.

Walaa avatar
Walaa
Support Team
Posts: 14952
Joined: 21-Aug-2005
# Posted on: 25-May-2009 08:46:30   

2.6.8.723

This is a very old version, would you please use the latest one.

They are both Prov, char(2), not null.

Do the matching rows have exact value in the PK and the corresponding FK field.

e.g. PK = ' 1' FK = '1 ' Won't work.

edalzell
User
Posts: 44
Joined: 27-May-2008
# Posted on: 25-May-2009 18:50:03   

Upgrading to the latest version seems to have fixed it for me. I didn't realize I was so far behind.

Thanks again, for the outstanding support.