Hi,

When a CollectionChanged with action Remove is fired, the Entity has IsRemove = true. Any access to the object cause the 'Entity is removed' Exception. We think that this is a bit too strict. When we get the object from DO we sometimes need the info in the object do determine which object we have to delete in our own list. We can however not reach this information because of the mentioned exception. Would it be possible to allow read-only access to the object?

Regards Paul Sinnema Diartis AG

asked Nov 22 '10 at 08:04

Paul%20Sinnema's gravatar image

Paul Sinnema
261888896

edited Nov 23 '10 at 03:10

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412


One Answer:

I'm thinking about adding something like this:

var sessionConfiguration = ...;
sessionConfiguration.Options |= SessionOptions.AccessRemovedObjects;
using (var session = domain.OpenSession(sessionConfiguration)) {
  var person = ...; 
  person.Remove();
  Console.WriteLine("Person name: {0}", person.Name);
}

Will this be enough to solve the problem?

answered Nov 23 '10 at 03:13

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Hi Alex,

We don't need and would even want to prevent write access to removed objects. So the getters are ok but the setters are forbidden.

Regards
Paul

(Nov 23 '10 at 03:20) Paul Sinnema Paul%20Sinnema's gravatar image

Yep, that's exactly what this implies. Can't modify, but can read. So likely the flag must be renamed.

(Nov 23 '10 at 03:33) Alex Yakunin Alex%20Yakunin's gravatar image

Is this going to be in 3.4.4?

(Nov 24 '10 at 14:10) Paul Sinnema Paul%20Sinnema's gravatar image

Created & implemented: issue 855.

(Nov 26 '10 at 11:21) Alex Yakunin Alex%20Yakunin's gravatar image

Hi Alex,

Can we download this somewhere?

Regards Paul

(Dec 03 '10 at 03:30) Paul Sinnema Paul%20Sinnema's gravatar image

Not yet - installers will be updated on the end of this week (most likely, @ Saturday or Sunday).

(Dec 03 '10 at 04:16) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×574
×9
×7

Asked: Nov 22 '10 at 08:04

Seen: 4,898 times

Last updated: Dec 03 '10 at 05:33

powered by OSQA