This question is locked. New answers and comments are not allowed.
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
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
0
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.
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.
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
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
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.
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
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.
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 Details: Telerik.OpenAccess.SPI.Util.QueryExceptionHelper: Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
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:
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
0
Hello Alan,
The exception message tells you everything:
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.
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):
Server Error in '/' Application.
Exception Details: Telerik.OpenAccess.Exceptions.OptimisticVerificationException: Concurrent update detected on property 'InternalUse'.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
<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:
|
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
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.
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.