Entity with prefect paths some times returns null

Posts   
 
    
Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 19-Apr-2007 16:12:59   

I know this one will be impossible for you to troubleshoot with out seeing the code but maybe if you can point me in the right direction so I know where to put the break points in the generated code. The following code sometimes returns null for the prefetch path siteid_. It seems specific to certain records in the database. I ran the sql profiler and confirmed all of the sql statements issued by llblgen were returning data. Do you know where I should start debugging?


CircuitsEntity _entity = new CircuitsEntity(id);
        PrefetchPath2 _prefetch = new PrefetchPath2((int)EntityType.CircuitsEntity);
        _prefetch.Add(CircuitsEntity.PrefetchPathSiteid_);
        _prefetch[0].SubPath.Add(SiteidEntity.PrefetchPathCity);
        _prefetch[0].SubPath[0].SubPath.Add(CityEntity.PrefetchPathCntry);
        _prefetch[0].SubPath[0].SubPath[0].SubPath.Add(CntryEntity.PrefetchPathRegion);
        _prefetch.Add(CircuitsEntity.PrefetchPathBu_);
        _prefetch.Add(CircuitsEntity.PrefetchPathCarrier_).SubPath.Add(CarrierEntity.PrefetchPathCarrierCont);
        _prefetch.Add(CircuitsEntity.PrefetchPathServiceType_);
        _prefetch.Add(CircuitsEntity.PrefetchPathSupportlvl_);

Thanks, Brandt

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-Apr-2007 16:28:54   

Please provide more information: DataBase Type, Runtime Library Version...etc Guidelines: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7720

Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 19-Apr-2007 16:49:03   

Sorry about that. Database is SQL 2005, LBLGenVersion 2.0.0.0 Final - March,21 2007. I am also using a modified ORMSupportClasses from Otis to fix the LLBLGenDataSource session naming.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-Apr-2007 16:51:53   

Can you attache a repro (the database schema and the project)?

Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 19-Apr-2007 16:59:28   

Walaa wrote:

Can you attache a repro (the database schema and the project)?

It looks like we fixed the problem by changing some of the fields to null. It is possible that some of the data had odd non visible characters. Should llblgen throw an exception if the data is malformed when it retreives the data from sql. Is there any sql command that you know of that will show all of the hidden characters?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2007 10:58:53   

Should llblgen throw an exception if the data is malformed when it retreives the data from sql.

Only if it violates the generated corresponding field's .NET type.

Is there any sql command that you know of that will show all of the hidden characters?

It's my first time to hear about hidden characters in sql.

Brandt
User
Posts: 142
Joined: 04-Apr-2007
# Posted on: 20-Apr-2007 13:57:46   

Walaa wrote:

Should llblgen throw an exception if the data is malformed when it retreives the data from sql.

Only if it violates the generated corresponding field's .NET type.

Is there any sql command that you know of that will show all of the hidden characters?

It's my first time to hear about hidden characters in sql.

Hidden Characters - like /r/n will not appear, however if you are displaying a record out of band (ajax) it can cause havock on the page.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Apr-2007 17:21:20   

Hidden Characters - like /r/n will not appear, however if you are displaying a record out of band (ajax) it can cause havock on the page.

I see, but I don't know of a sql function to display those characters.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39922
Joined: 17-Aug-2003
# Posted on: 20-Apr-2007 21:02:09   

LLBLGen Pro doesn't do any converting of data send/received by itself. You have to do that IF you want to do that in a type converter for example. You could for example strip off \n chars in a type converter which converts to the same type simple_smile

Frans Bouma | Lead developer LLBLGen Pro