First let me say that I am impressed with Blinq. I am haveing a bit of a problem, and perhaps it's due to my lack of Linq understanding. When I attempt to update a row I always get the error System.Data.DLinq.OptimisticConcurrencyException:
Row not found or changed" This test database is not being used by any other application, and I even attempted to modify the UpdateCheck property of the ColumnAttribute to never, same result.
Ed, this error occurs when Linq thinks that one of the fields you´re updating or displaying has been changed since you loaded the page. Do you have a high precision date/time field? If so, the reason may be that your field has more precision than the GridView
is storing. There is a Readme.txt Known Issue item on how to fix this issue.
If you don´t think it´s a date/time issue, the best thing to do is to narrow down which field is causing the problem. If you change the optimistic concurrency (UpdateMode) setting in your database.cs file for the field that´s causing the problem, the problem should
go away. There´s a section in the Readme that explains how to change the UpdateMode for a field as well.
Please tell us if you figure out which field is causing the problem so we can understand the problem, fix any bugs that might exist, and help others if they come across this same issue.
Thanks!
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
I'm also having this problem, but cannot find the section in the readme that explains how to change UpdateMode ... can you possibly point me to the exact url or file.
thanks!
ps. I also attempted to get around this issue by changing ConflictDetection="OverwriteChanges" (was previously ConflictDetection="CompareAllValues"
This resulted in the error below.
PageDataSource 'AllColumnDataTypesDataSource' could not find a non-generic method 'Update' that takes parameters of type 'LINQ_WebSite.AllColumnDataTypes'.
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: System.InvalidOperationException: PageDataSource 'AllColumnDataTypesDataSource' could not find a non-generic method 'Update' that takes parameters of type 'LINQ_WebSite.AllColumnDataTypes'.
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.
Warren, changing the ConflictDetection mode on the ObjectDataSource tells the ObjectDataSource that you want it to look for a method that doesn't take in any of the original field values. Therefore, changing this mode will make the ObjectDataSource look
for an update method that takes a different set of arguments. Hence the "could not find a non-generic method..." error.
Looks like you found the right solution on your own- when you want just one field to not participate in optimistic concurrency, change its UpdateCheck property on the ColumnAttribute in the Database.cs or Database.vb file. The other fields will continue
to participate in optimistic concurrency and the method signiture that the ObjectDataSource searches for won't change.
Polita Paulus
This posting is provided "AS IS" with no warranties, and confers no rights.
Ed Word
Member
45 Points
9 Posts
Update Challenge
Jun 22, 2006 08:45 PM|LINK
First let me say that I am impressed with Blinq. I am haveing a bit of a problem, and perhaps it's due to my lack of Linq understanding. When I attempt to update a row I always get the error System.Data.DLinq.OptimisticConcurrencyException: Row not found or changed" This test database is not being used by any other application, and I even attempted to modify the UpdateCheck property of the ColumnAttribute to never, same result.
Thanks
kashif
Contributor
2748 Points
547 Posts
Microsoft
Re: Update Challenge
Jun 22, 2006 09:11 PM|LINK
Ed Word
Member
45 Points
9 Posts
Re: Update Challenge
Jun 22, 2006 09:18 PM|LINK
I'm not sure if this is what you need, but here it is:
[OptimisticConcurrencyException: Row not found or changed.]
System.Data.DLinq.ChangeProcessor.ThrowOptimisticConcurrencyException(List`1 failedUpdates, Int32 totalUpdatesAttempted) +171
System.Data.DLinq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) +522
System.Data.DLinq.DataContext.SubmitChanges(ConflictMode failureMode) +229
System.Data.DLinq.DataContext.SubmitChanges() +6
Customer.Update(Customer original_x, Customer x) in c:\Inetpub\wwwroot\TestBinq\App_Code\StaticMethods.cs:1200
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +358
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method) +38
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +2573
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1215
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +858
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +117
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Thanks
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Update Challenge
Jun 23, 2006 07:28 AM|LINK
Ed, this error occurs when Linq thinks that one of the fields you´re updating or displaying has been changed since you loaded the page. Do you have a high precision date/time field? If so, the reason may be that your field has more precision than the GridView is storing. There is a Readme.txt Known Issue item on how to fix this issue.
If you don´t think it´s a date/time issue, the best thing to do is to narrow down which field is causing the problem. If you change the optimistic concurrency (UpdateMode) setting in your database.cs file for the field that´s causing the problem, the problem should go away. There´s a section in the Readme that explains how to change the UpdateMode for a field as well.
Please tell us if you figure out which field is causing the problem so we can understand the problem, fix any bugs that might exist, and help others if they come across this same issue.
Thanks!
This posting is provided "AS IS" with no warranties, and confers no rights.
warrenroscoe
Member
37 Points
8 Posts
Re: Update Challenge
Jul 04, 2006 02:50 PM|LINK
I'm also having this problem, but cannot find the section in the readme that explains how to change UpdateMode ... can you possibly point me to the exact url or file.
thanks!
ps. I also attempted to get around this issue by changing ConflictDetection="OverwriteChanges" (was previously ConflictDetection="CompareAllValues"
This resulted in the error below.
PageDataSource 'AllColumnDataTypesDataSource' could not find a non-generic method 'Update' that takes parameters of type 'LINQ_WebSite.AllColumnDataTypes'.
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: System.InvalidOperationException: PageDataSource 'AllColumnDataTypesDataSource' could not find a non-generic method 'Update' that takes parameters of type 'LINQ_WebSite.AllColumnDataTypes'.
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:
[InvalidOperationException: PageDataSource 'AllColumnDataTypesDataSource' could not find a non-generic method 'Update' that takes parameters of type 'LINQ_WebSite.AllColumnDataTypes'.]
Microsoft.Web.UI.Controls.PageDataSourceView.GetResolvedMethodData(String methodName, Type dataObjectType, Object oldDataObject, Object newDataObject, DataSourceOperation operation) +581
Microsoft.Web.UI.Controls.PageDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +1168
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +162
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +175
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840
warrenroscoe
Member
37 Points
8 Posts
Re: Update Challenge
Jul 04, 2006 03:09 PM|LINK
Doh! OK I found out what to do ...
[Column(Name="clmSmallDateTime", Storage="_ClmSmallDateTime", DBType="SmallDateTime", UpdateCheck=System.Data.DLinq.UpdateCheck.Never)]
But - I'd still like to know what I did wrong as regards the ConflictDetection="OverwriteChanges" modification.
phuff
Contributor
2700 Points
547 Posts
Microsoft
Re: Update Challenge
Jul 05, 2006 06:06 PM|LINK
Warren, changing the ConflictDetection mode on the ObjectDataSource tells the ObjectDataSource that you want it to look for a method that doesn't take in any of the original field values. Therefore, changing this mode will make the ObjectDataSource look for an update method that takes a different set of arguments. Hence the "could not find a non-generic method..." error.
Looks like you found the right solution on your own- when you want just one field to not participate in optimistic concurrency, change its UpdateCheck property on the ColumnAttribute in the Database.cs or Database.vb file. The other fields will continue to participate in optimistic concurrency and the method signiture that the ObjectDataSource searches for won't change.
This posting is provided "AS IS" with no warranties, and confers no rights.