Get changed entities in R4

19 views
Skip to first unread message

Marcelo Volmaro

unread,
Sep 19, 2017, 4:22:11 PM9/19/17
to RavenDB - 2nd generation document database
Hi. Is there a way to get which entities were changed in the current session, without having to resort to async methods?

I'm using async sessions, and I know I can do session.Advanced.WhatChanged() that I guess that it returns the key/property[] of what changed, but I would like to simply get the changed entity (that should be in memory).
I of course can do session.LoadAsync(id), but the point is not to have to do that as I can't await on the method I need those changes.

Oren Eini (Ayende Rahien)

unread,
Sep 19, 2017, 4:38:09 PM9/19/17
to ravendb

asyncSession.LoadAsync<object>(session.Advanced.WhatChanged().Keys).Result

 should probably do this, IIRC.
This is guaranteed not to do any async work


Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcelo Volmaro

unread,
Sep 19, 2017, 4:42:40 PM9/19/17
to RavenDB - 2nd generation document database
Mmm.. ok... Yes, I know that, but that "smells" bad... Using the .Result of a Task is not something I would use (unless I know in advance the task will be already resolved because Task.WhenAll or whatever similar pattern)...
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Sep 19, 2017, 4:45:12 PM9/19/17
to ravendb
There is no other way to access the session state
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages