DevExpress eXpressApp Framework (XAF) and Permanent eXpress Objects (XPO): how to speed up association load times?

I have a problem with the speed of accessing the association property with a large number of records.

I have an XAF application with a parent class named MyParent.

There MyParentare 230 entries.

MyParenthas a child class with a name MyChild.

There MyChildare 49,000 entries.

I have an association defined between MyParentand in a MyChildstandard way:

In MyChild:

// MyChild (many) and MyParent (one)
[Association("MyChild-MyParent")]
public MyParent MyParent;

And in MyParent:

[Association("MyChild-MyParent", typeof(MyChild))]
public XPCollection<MyCHild> MyCHildren
{
     get { return GetCollection<MyCHild>("MyCHildren"); }
}

There is a special entry MyParentcalled MyParent1.

For MyParent1there are records 630 MyChild.

I have a DetailView for a class named MyUI.

MyUI DetailView, MyChild.

MyParent1 .

MyUI, MyChild .

:

[NonPersistent]
public XPCollection<MyChild> DisplayedValues
{
    get
    {
        Session theSession;
        MyParent theParentValue;
        XPCollection<MyCHild> theChildren;

        theParentValue = this.DropDownOne;
        // get the parent value

        if theValue == null)
        {
            // if none

            return null;
            // return null
        }

        theChildren = theParentValue.MyChildren;
        // get the child values for the parent

        return theChildren;
        // return it
    }

DisplayedValues NonPersistent, DetailVIew. , , , , , .

, theParentValue = this.DropDownOne 45 .

:

  • Vista Business
  • 8
  • 2.33 E6550
  • SQL Server Express 2005

, DetailView.

-, :

  • ?

  • () DetailView, ?

, , 630 , . , 49 000, 630. 100 -down .

, . .

, , .

+3
4

-, , , , XPO 30 70% , , .

DevExpress , .., , - - , , , , , XPO, , - , ( ) SQL ( IDataStore), , , / , .

+2

, , . ​​:

public class A : XPObject
{
    [Association("a<b", typeof(b))]
    public XPCollection<b> bs { get { GetCollection("bs"); } }
}

public class B : XPObject
{
    [Association("a<b") Persistent("Aid")]
    public A a { get; set; }
}

, (, lookupEdit)

A myA = GetSomeParticularA();
lupAsBs.Properties.DataSource = myA.Bs;
lupAsBs.Properties.DisplayMember = "WhateverPropertyName";

, XPO , .

+1

. , .

SQL- .

, XAF /, XAF?

, , DetailView.

0

, XAF.

The first time you click on the drop-down list (watch list) (in the detailed view), two queries will be added to the database to fill the list. In my tests, sometimes the whole object is loaded into the original collection, and not only the properties of the identifier and name, as we thought, depend on your objects, which you might want to use easier for lists. You can also enable server mode in the list, then only 128 objects are loaded each time.

0
source

Source: https://habr.com/ru/post/1696862/


All Articles