This is a migrated thread and some comments may be shown as answers.

Database Locking

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
robert hutchison
Top achievements
Rank 1
robert hutchison asked on 30 May 2013, 12:04 PM
We have noticed as we are testing our Silverlight/Telerik admin app along with our back-end product that whenever pages that use a large number of Telerik RadGridView controls are viewed during our testing, the controls put locks on the database tables or groups of pages and cause deadlocks in the application.  This causes the back-end application to fail.

We can tell it is the Telerik controls that do this because there is enough information in the SQL profile trace to link it back to the specific page that has the controls on it and we can see the statements behind the controls running.

When this deadlock is occurring, all of the RadGridView controls on that page have IsReadOnly="True".  It is safe to assume that the SL application doesn't need to lock anything because it is only viewing a queue - an independent back-end application is making all changes to the database - this SL application should not be interfering with its operation.

Here is an example of the beginning of one of these grids:


<telerikGridView:RadGridView Name="ViewWaitingMessages_AllRadGridView"
             Height="250"
             AutoExpandGroups="True"
             AutoGenerateColumns="False"
             HorizontalGridLinesBrush="DarkOliveGreen"
             IsBusy="{Binding IsBusy,
             ElementName=ViewWaitingMessages_AllDomainDataSource}"
             IsReadOnly="True"
             IsSynchronizedWithCurrentItem="False"
             ItemsSource="{Binding ElementName=ViewWaitingMessages_AllDomainDataSource,
                         Path=Data}"
             RowHeight="20"                                                              
             RowIndicatorVisibility="Visible"
             SelectionMode="Extended"
             VerticalGridLinesBrush="DarkOliveGreen">
 
            <telerikGridView:RadGridView.Columns>
                           ...

We use the RadDomainDataSource, but I didn't see that it had a read-only option or anything to do with database locking there.

My first guess would be to set "CanUserAdd" to False, "CanUserDelete" to "False", IsReadOnly" = "True", then create a new function in the server-side domain services file that does the same SELECT, but with "NOLOCK". I am unsettled in this approach because I am guessing that either:

  • there is already a standard way to do this (I would assume that this is a pretty common thing that people need to do)
  • there is something inside the control that is going establish locks anyway and this would be a waste of time

Thanks,
Rob

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 30 May 2013, 02:54 PM
Hi,

I have answered the other thread.

Regards,
Rossen Hristov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
robert hutchison
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or