Notification from untracked entity received

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
-marcelo-
Posts: 26
Joined: Wed 28 Jun 2017 12:35

Notification from untracked entity received

Post by -marcelo- » Tue 15 Aug 2017 15:48

I´m trying to use a DataContext to read data from the database in a using statement.
Then, when some changes are done to some entity, send the updates using code as follows.
I supposed that the Attach() method was the way to go. But even if I´m updating the (only in this case) property after the Attach(), I´m getting the exception in the subject. The source is Devart.Data.Linq.
What is the correct way? Or must I maintain the DataContext through the entire life of the application?
TIA

Code: Select all

                using (FormPrintingDataContext context = FormPrintingDataContext.Get( "nmwiu", "public" )) {
                    try { 
                        context.FormPrintingStorages.Attach(chgdinstance, readinstance);
                        chgdinstance.Definition = definition;
                    }
                    catch (Exception e) {
                        MessageBox.Show(String.Format("{0}{1}{2}", e.Message, Environment.NewLine,
                            e.InnerException != null ? e.InnerException.Message : "No more info"));
                    }
                    finally { 
                        context.SubmitChanges();
                    }
                }


Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Notification from untracked entity received

Post by Shalex » Wed 16 Aug 2017 11:56

We cannot reproduce the problem in our environment.

1. Please modify the project (we just sent it to your email) to reproduce the error and send it back to us.

2. Specify the full stack trace of the error.

Post Reply