ContextSwitchDeadlock when loading too many rows to VirtualQueryableCollectionView

1 posts, 0 answers
  1. Paul Schwartzberg
    Paul Schwartzberg avatar
    4 posts
    Member since:
    Feb 2006

    Posted 07 Oct Link to this post

    Hello,

    At this line

    • public DataServiceCollection<CustomerDto> Customers = new DataServiceCollection<CustomerDto>(Container.Customers.IncludeTotalCount());

    in the code below i am getting the  ContextSwitchDeadlock exception when loading 100 000 to  VirtualQueryableCollectionView using an OData v4 rest service.  The VirtualQueryableCollectionView  is boud to the ItemsSource of the RadGridControl

    If i deactivate ContextSwitchDeadlock in the Exception Settngs of VS2015 it just takes 10 - 15 minutes for the rows "to load". 

    Why is this?  

    Why the ContextSwitchDeadlock (how would i prevent it)??

    I thought the idea of VirtualQueryableCollectionView is that it returns in a jiffy (isnt that what data virtualisation is about?) with a couple hundred rows, and then loads the rest as we scroll.  It shouldnt take 10 - 15 minutes just to start up.

    I would like to reactivate ContextSwitchDeadlock Exception Setting in VS2015 and debug without the exception being raised.

    Any ideas on how to go about it?

    Also i would like to solve the issue of the long load time - that isnt data virtualisation.  What causes it?  How to solve it?  Should i rather use the DataServiceDataSource? Is the VirtualQueryableCollectionView is wrong candidate for loading large quantities of data in small bites?

    If a full demo of the VS2015 solution is needed to answer this, you can download here (use the Inserting10000Customers.sql file in it to the Customer SQL Express table with 100 000 rows), at:    https://app.box.com/s/73dufnlkf63se19ehhzfzz6upevbn92m

    Hope someone at Telerik or someone who knows answers.

    Paul S.

    nb. removing IncludeTotalCount() doesnt change the problem.

     

      public partial class MainWindow
        {
            private static readonly Container Container = new Container(new Uri("http://localhost:21026/")); //http://localhost:21026/
            public DataServiceCollection<CustomerDto> Customers = new DataServiceCollection<CustomerDto>(Container.Customers.IncludeTotalCount());
            public MainWindow()
            {
                InitializeComponent();
                IQueryable<CustomerDto> test = Customers.OrderBy(o => o.Name).AsQueryable();
                var source = new VirtualQueryableCollectionView(test) { LoadSize = 1000 };
     
               // source.ItemsLoading += Source_ItemsLoading;
     
                DataContext = source;
     
            }
     
            private void Source_ItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
            { }
        }
    }

     

     

     

    <Window x:Class="ODataAndAutoMapper.Telerik.UI.MainWindow"
            xmlns:controls="http://schemas.telerik.com/2008/xaml/presentation"
            mc:Ignorable="d">
        <Grid>
            <controls:RadGridView ItemsSource="{Binding}" FilteringMode="FilterRow"/>
             
        </Grid>
    </Window>

Back to Top