InvalidOperationException: Cannot save object with state: f.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Marcus
Posts: 7
Joined: Fri 20 Mar 2009 08:42

InvalidOperationException: Cannot save object with state: f.

Post by Marcus » Thu 12 Nov 2009 10:19

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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 12 Nov 2009 12:16

What version of dotConnect for Oracle are you using?

Marcus
Posts: 7
Joined: Fri 20 Mar 2009 08:42

Post by Marcus » Thu 12 Nov 2009 12:27

Hi Andrey,

Version: 5.25.44.0

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 12 Nov 2009 13:39

Could you please try to reproduce the problem using dotConnect for Oracle 5.35.65 Beta?

Marcus
Posts: 7
Joined: Fri 20 Mar 2009 08:42

Post by Marcus » Thu 12 Nov 2009 13:53

In the version dotConnect for Oracle 5.35.65 Beta is the same problem.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 16 Nov 2009 11:40

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).

Post Reply