After remove() + refresh() child-record still in cachedList

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
afva
Posts: 39
Joined: Thu 13 Aug 2009 21:22

After remove() + refresh() child-record still in cachedList

Post by afva » Thu 15 Dec 2011 13:52

Hello,

I have a parent and a child table (a Person can have multiple bank-accounts).

If a users makes some changes and then wants to move to another 'Person' or closes the form, he gets a question: 'Do you want to save the changes'.
If he says 'no' I need to get back to the old values, so I do a
this.DB.Refresh(RefreshMode.OverwriteCurrentValues, Person);

The problem arises when the user added a child-record (a new bank-account).
I know refresh() only works for updates, so I remove the child-record first:
Person.Child-Table.Remove(brek);
this.DB.Refresh(RefreshMode.OverwriteCurrentValues, Person);

I can see that the child-record no longer referes to the Person (is null), and in the Person-record
Person.Child-Table.Count = 0
(In the properties window I have: ("Delete On Null = True")

But...the Person still shows the (just deleted) bankacount!
If I do a save(), this just deleted record is also saved.

In the watch-window I can see (Non-Public members) that the "cachedList" still holds the just deleted child.
How can I fix this?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 16 Dec 2011 15:31

Could you please specify the version of LinqConnect you are working with? There were some related fixes in the new builds, and we couldn't reproduce the issue in our environment when using the latest 3.1.19 version of LinqConnect.

Please try updating to LinqConnect 3.1.19 and tell us if this helps.

afva
Posts: 39
Joined: Thu 13 Aug 2009 21:22

Post by afva » Fri 16 Dec 2011 15:51

oeps.. Sorry, I think I put this in the wrong forum.
We are using:
Devart dotConnect for Oracle 60.46.0
Devart Entty Developer 3.0.38.0
Devart OraDeveloper Tools 2.60

Do I have to ask this question on the other forum?

Thank you,

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Mon 19 Dec 2011 16:57

The issue you've described should be fixed in the latest 6.60.258 build of dotConnect for Oracle. Please try updating to it and tell us if this helps.

JIC: you can ask questions on the LinqConnect support for Oracle databases on either the LinqConnect or dotConnect for Oracle forum.

afva
Posts: 39
Joined: Thu 13 Aug 2009 21:22

Post by afva » Tue 20 Dec 2011 14:57

Hello StanislavK,

We upgraded today.
The versions now are:
Devart DotConnect for Oracle 6.60.258.0
Devart Entity Developer 4.2.85.0

We still have the same problem.
Can you look at this again please?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Wed 21 Dec 2011 16:44

I've sent you a test project, please check that it was not blocked by your mail filter.

In the sample, an entity is loaded from the database and modified. Besides that, a new 'child' entity is added. After that, the new 'child' entity is removed, and the first entity is refreshed with the values loaded from the database. In our environment, this results in no changes being saved for either the first or the 'child' object.

Please specify what should be changed in the sample to reproduce the issue, or send us your test project.

afva
Posts: 39
Joined: Thu 13 Aug 2009 21:22

Post by afva » Thu 22 Dec 2011 11:14

Hello Stanislav,

Your test projects works fine here. But then, in your project, the cachedList from DEPT, is always 'null'.
If I make a binding in XAML (DataContext="{Binding Path=EMPs}") the cachedList is filled. Is ther some documentation on this cachedList?

I alterd the project the way I work with it. I also added a document with some snapshots from my watch-window. I send this to your email-account.
Will you please look at it again?

Thank you,

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Fri 23 Dec 2011 15:12

Thank you for your assistance, we have reproduced the binding issue. We will analyze it and inform you about the results.

Post Reply