Page 1 of 1

InvalidOperationException: Cannot save object with state: f.

Posted: Thu 12 Nov 2009 10:19
by Marcus
Hi,

i get the message when i raised SubmitChanges() in my Datacontext.

Here is my workflow...

1.) I will delete a line

Code: Select all

MyDataContext.Tab_Customers.DeleteOnSubmit(Me.Tab_CustomerBindingSource.Current)             
MyDataContext.SubmitChanges()
2.) I raised my own validationException ("You cannot delete this record") and refresh the CurrentRecord with...

Code: Select all

MyDataContext.Refresh(Data.Linq.RefreshMode.OverwriteCurrentValues, Me.Tab_CustomerBindingSource.List)
3.) and now when i changed the record and call the submitChanges method then i get the following message:

System.InvalidOperationException: Cannot save object with state: f.
bei Devart.Data.Linq.k.a(List`1 A_0)
bei Devart.Data.Linq.k.a(DataContext A_0, ConflictMode A_1)
bei Devart.Data.Linq.k.b(DataContext A_0, ConflictMode A_1)
bei Devart.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
bei Devart.Data.Linq.DataContext.SubmitChanges()

Do you now where is my problem? How can i refresh the "object state" of this record?

Regards,
Marcus

Posted: Thu 12 Nov 2009 12:16
by AndreyR
What version of dotConnect for Oracle are you using?

Posted: Thu 12 Nov 2009 12:27
by Marcus
Hi Andrey,

Version: 5.25.44.0

Posted: Thu 12 Nov 2009 13:39
by AndreyR
Could you please try to reproduce the problem using dotConnect for Oracle 5.35.65 Beta?

Posted: Thu 12 Nov 2009 13:53
by Marcus
In the version dotConnect for Oracle 5.35.65 Beta is the same problem.

Posted: Mon 16 Nov 2009 11:40
by AndreyR
Thank you for the report, we have already fixed the problem.
The fix will be included in the next build.
However, please note that if you call DeleteOnSubmit, object is detached from context and any changes
made to it will not be posted to database until this object is attached again (it will be enough to query it
or call the Attach method explicitly).