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

Concurrent update detected - problem

11 Answers 332 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Steve
Top achievements
Rank 1
Steve asked on 28 Apr 2009, 01:30 PM
hi,

I'm totally lost on this problem.

I have some fields that if I include them in the DAL I cannot update - but other fields with the same criteria seem to work.

I decided to create the simplest example to get to grips with OA which is:



I have mapped 1 table (Customer) using OA.
I have a Web Application using that DAL.
Create a form with a RadGrid and an OpenAccessDataSource populated by the Customer Class.

I can page, sort(after the latest patch - that had me going for a while too), group etc.
However, when I edit a record I get the 'Concurrent update detected' error on a particular field.

Working my way back I can remove fields from the DAL and the edits work fine - sometimes.

So, I created the DAL with only the record ID and 1 more field.
All works fine.
Then I replaced the second field with the one I was getting the error with - and it fails.
After looking at the field(a nullable nvarchar) I thought maybe it was the nulls? - desperate now.

So I replaced the field with another that was also a nullable nvarchar with null values stored too.
And this works fine!

I don't think its the naming of the fields that are causing this - cusTelWork (fails), cusAddress2 (works).

Any ideas? - I'm stumped.

Thanks in advance

11 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 05 May 2009, 09:40 AM
Hello Steve,
The problem occurs because the RadGrid is always reporting null as old values per default. This leads to a comparison from null to "" which is false and generates the exception. This has been fixed now.

To get a working application immediately you should specify ConvertEmptyStringToNull=false in all your editable grid columns.

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name" 
    
SortExpression="Name" UniqueName="Name" ConvertEmptyStringToNull=false>
</telerik:GridBoundColumn>

 


Now the OpenAccessDatasource always gets a "" instead of null. You should do this setting related to your database column definition. Maybe a "" is what you want by default.

All the best,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Steve
Top achievements
Rank 1
answered on 05 May 2009, 11:13 AM
Thanks Jan,

it did boil down to only occuring when the field I wanted to edit contained an empty string - but was OK when if it had a value (or NULL) already stored.

Thanks for that,

Best regards,

Steve
0
Alan
Top achievements
Rank 1
answered on 10 Jun 2009, 02:49 AM
I am having the same problem with Bit type fields in the SQL Server database.  I am using a checkbox in the RadGrid (also rendered in the auto-generated edit form).  I have set the ConvertEmptyStringToNull = "false" and still getting the concurrent access detected.  What do you suggest now?
0
Jan Blessenohl
Telerik team
answered on 10 Jun 2009, 06:51 AM
Hello Alan,
The problem should be solved in the latest internal build. Can you please download it from your download area?

Kind regards,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alan
Top achievements
Rank 1
answered on 10 Jun 2009, 01:34 PM
Upgraded.  Now I get:

Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.

Any clues?

Alan

0
Jan Blessenohl
Telerik team
answered on 10 Jun 2009, 03:17 PM
Hello Alan,
This type of exception is only thrown from our OQL implementation, looks like some problem with a query string. But without the exception message and the callstack I cannot say more.

Greetings,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alan
Top achievements
Rank 1
answered on 10 Jun 2009, 04:02 PM
Here you go:

 

Server Error in '/' Application.

Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.OpenAccess.SPI.Util.QueryExceptionHelper: Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[QueryExceptionHelper: Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.]

[QueryException: line 1:76: Unknown type for "LookupType"; Are you missing a FieldAlias attribute?; String literals must be 'quoted'.]
   Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
   Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34
   OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.compileQuery(ImmutableQueryDetails query) +239
   OpenAccessRuntime.DataObjects.OpenAccessQueryImp.compile() +106
   Telerik.OpenAccess.RT.QueryImpl.Compile() +34
   Telerik.OpenAccess.RT.QueryImpl.Execute(Object[] args) +91
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteOqlQuery(IQuery oqlQuery, Object[] queryArguments, Int32 startRowIndex, Int32 maximumRows) +136
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +636
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +114
   Telerik.Web.UI.RadComboBox.PerformSelect() +37
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.Control.DataBindChildren() +211
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
   System.Web.UI.Control.DataBind() +15
   Telerik.Web.UI.GridEditFormItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +387
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +979
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +187
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1077
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +778
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +28
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +364
   Telerik.Web.UI.GridTableView.Rebind() +98
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +395
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
0
Jan Blessenohl
Telerik team
answered on 10 Jun 2009, 04:30 PM
Hello Alan,
The exception message tells you everything:
[QueryException: line 1:76: Unknown type for "LookupType"; Are you missing a FieldAlias attribute?; String literals must be 'quoted'.]
You have a query in your datasource definition that uses a LookupType property. This LookupType is not longer there or it has no FieldAlias attribute set so that we know which field we should include into the query.

Regards,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alan
Top achievements
Rank 1
answered on 10 Jun 2009, 07:47 PM
I corrected the issue with the query for the combobox (which did not throw an error with previous OA build).  Now, I'm finally back to the exact same problem before I got the latest internal build.  I'm rendering field InternalUse as a telerik:GridCheckBoxColumn as follows (so that it will appear that way on the auto-generated Edit form):

 

 

 

<telerik:GridCheckBoxColumn

 

 

UniqueName="InternalUse"

 

 

HeaderText="Internal"

 

 

HeaderStyle-HorizontalAlign="Center"

 

 

DataField="InternalUse"

 

 

AllowSorting="true"

 

 

ReadOnly="false"

 

 

ConvertEmptyStringToNull="false"

 

 

>

 

 

 

<ItemStyle HorizontalAlign="Center" Wrap="False" />

 

 

</telerik:GridCheckBoxColumn>

 

 

 

 

 

Here is the error:
 

Server Error in '/' Application.

Concurrent update detected on property 'InternalUse'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.OpenAccess.Exceptions.OptimisticVerificationException: Concurrent update detected on property 'InternalUse'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[OptimisticVerificationException: Concurrent update detected on property 'InternalUse'.]
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.CheckOldValueInformation(PersistenceCapable pc, IDictionary keys, IDictionary oldValues) +369
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.CheckVersionInformation(PersistenceCapable pc, IDictionary keys, IDictionary oldValues, String oldVersion) +89
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +523
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92
   Telerik.Web.UI.GridTableView.PerformUpdate(GridEditableItem editedItem, Boolean suppressRebind) +353
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +1996
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridEditFormItem.OnBubbleEvent(Object source, EventArgs e) +439
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
0
Alan
Top achievements
Rank 1
answered on 11 Jun 2009, 11:57 PM
So, can anybody from Telerik give me a clue?
0
Alexander
Telerik team
answered on 12 Jun 2009, 04:01 PM
Hello Alan,

Initially we thought this was a bug, but it seems there is a logical explanation of the problem. The checkbox has only two states - True and False. And when we try to set a NULL there (coming from the DataSource), the CheckBox cannot recognize the value and therefore it changes this value to the default one - False. The problem comes when we try to update this field. The DataSource tries to store it, but in the meanwhile the Grid's ComboBox has already changed the value from NULL to False. And this is the concurrency issue from the exception. Note that updating objects with True or False value in this field goes without errors. A possible workaround as long as you are using nullable bits is to use a regular GridBoundColumn. There you can specify True, False or leave the field blank to store a NULL value. Hope that helps.

Best wishes,
Alexander
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Steve
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Steve
Top achievements
Rank 1
Alan
Top achievements
Rank 1
Alexander
Telerik team
Share this question
or