Error using paging, starting with page 2

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 06-Sep-2007 12:14:00   

Hi,

I have a project, ID 12. This project has 3 pictures related. I use this code:

public static EntityCollection<PictureEntity> GetPicturesByProjectID(int projectID, int pageNumber, int pageSize)
        {
            //Add a relation to project, filtering pictures on projectID
            ProjectEntity project = new ProjectEntity(projectID);
            EntityCollection<PictureEntity> pictures = new EntityCollection<PictureEntity>();

            ExcludeIncludeFieldsList excludedFields = new ExcludeIncludeFieldsList();
            //Exclude Data from the entities
            excludedFields.Add(PictureFields.Data);

            //Add a sorter
            ISortExpression sorter = new SortExpression();
            sorter.Add(PictureFields.Id | SortOperator.Descending);

            //use the adapter to fetch a collection
            using (DataAccessAdapter adapter = new DataAccessAdapter())
            {
                adapter.FetchEntityCollection(pictures, project.GetRelationInfoPictures(), 0, sorter, null, excludedFields, pageNumber, pageSize);
            }

            return pictures;
        }

First Time: projectID = 12, pageNumber = 1, pageSize = 1. This works great

Second Time: projectID = 12, pageNumber = 2, pageSize = 1.

Here I get an error and here is the stacktrace:


   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreateColumn(IFieldPersistenceInfo persistenceInfo, String fieldName)
   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.ManglePageSelectDQ(IRetrievalQuery& selectQuery, IEntityFieldCore[] selectList, IFieldPersistenceInfo[] persistenceInfo, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.DQE.SqlServer.DynamicQueryEngine.CreatePagingSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DynamicQueryEngineBase.CreateSelectDQ(IEntityFieldCore[] selectList, IFieldPersistenceInfo[] fieldsPersistenceInfo, IDbConnection connectionToUse, IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.CreateSelectDQ(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfoObjects, IPredicateExpression filter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relationsToWalk, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollectionInternal(IEntityCollection2 collectionToFill, IRelationPredicateBucket& filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityCollection(IEntityCollection2 collectionToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize)
   at Statoil.FIND.LLBLGen.ManagerClasses.PictureManager.GetPicturesByProjectID(Int32 projectID, Int32 pageNumber, Int32 pageSize) in C:\\Projects\\XXXXX.FIND\\FIND.GUI\\Statoil.Find.Managers\\PictureManager.cs:line 43
   at Statoil.FIND.Business.PictureServicesImpl.GetPicturesByProjectID(Int32 projectID, Int32 pageNumber, Int32 pageSize) in C:\\Projects\\XXXXX.FIND\\FIND.GUI\\Statoil.FIND.Business\\PictureServicesImpl.cs:line 41
   at Statoil.FIND.Proxy.PictureServicesWrapper.GetPicturesByProjectID(Int32 projectID, Int32 pageNumber, Int32 pageSize) in C:\\Projects\\XXXXX.FIND\\FIND.GUI\\Statoil.FIND.Proxy\\PictureServicesWrapper.cs:line 47
   at FIND.GUI.ProjectOverview.btnImagesNext_Click(Object sender, EventArgs e) in C:\\Projects\\XXXXX.FIND\\FIND.GUI\\FIND.GUI\\ProjectOverview.aspx.cs:line 202
   at System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e)
   at System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Is there anyway of telling why this goes wrong?

Not sure if this is needed info, but the excludedfieldlist contains a blob field. There is one other blob field which I do to retrieve.

Best regards,

  • G.I.
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 06-Sep-2007 12:34:44   

What was the exception text? And which llblgen pro runtime library are you using?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 12:37:06   

WHich version of llblgen pro? runtime lib build nr? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 06-Sep-2007 13:17:44   

Sorry ... 2.5.07.0802

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 13:48:28   

G.I. wrote:

Sorry ... 2.5.07.0802

Could you try with the final instead of the beta? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 06-Sep-2007 14:06:50   

Installed new version, refreshed catalog, generated new code:

Here are the file versions: SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll: 2.5.7.831 SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll: 2.5.7.820

I still get the same error ...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 14:55:54   

I'll do an attempt to repro it. It could be it's the excluded fields.

(edit) Yep, it's the excluded field. Will fix it. (also present in Ase DQE btw) (fixed in next build (09062007)

Frans Bouma | Lead developer LLBLGen Pro
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 06-Sep-2007 15:32:03   

When and Where can I get this last build? Problem is we are already in the testing phase of the project, so this is kinda urgent ...confused

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 15:41:07   

G.I. wrote:

When and Where can I get this last build? Problem is we are already in the testing phase of the project, so this is kinda urgent ...confused

I'll attach a build for you to this message. Please be patient when we fix a bug, as we can't release multiple versions on a day, we often wait a couple of days to collect more things which could pop up so users don't have to download that much.

(edit) attached.

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.DQE.SqlServer.NET20.zip 11,222 06-Sep-2007 15:41.55 Approved
Frans Bouma | Lead developer LLBLGen Pro
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 06-Sep-2007 15:54:28   

Well, I can't complain about this service smile I have tested the DLL and the problem is fixed! Thank you so much!

I actually expected that some days would be necessary, because of much adminstration around new versions, so I hadn't expected this. I was just hoping that I would have it on monday morning, so this is exceptionally good!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 06-Sep-2007 16:37:57   

G.I. wrote:

Well, I can't complain about this service smile I have tested the DLL and the problem is fixed! Thank you so much!

I actually expected that some days would be necessary, because of much adminstration around new versions, so I hadn't expected this. I was just hoping that I would have it on monday morning, so this is exceptionally good!

Heh, no I will push a new build to the servers later today anyway, so it wouldn't be monday. It was just 1 simple if statement that was missing, so if that would help you out now, why wait? simple_smile (if the unittest succeeds of course)

Frans Bouma | Lead developer LLBLGen Pro