Skip to content

Conversation

@Danielle9897
Copy link
Member

@Danielle9897 Danielle9897 commented Nov 2, 2025

Related issue:
https://issues.hibernatingrhinos.com/issue/RDoc-3547/Evict-single-entity-Fix-article


C# @arekpalinski - pls review these latest files (for version 7.1)
(For earlier versions – 7.0, 6.2, 6.0, and 5.4 – the content was simply copied over)

docs/client-api/session/_what-is-a-session-and-how-does-it-work-csharp.mdx
(Just mentioned Evict in the "Unit of Work" section of the Session Overview article)

docs/client-api/session/how-to/_clear-a-session-csharp.mdx
docs/client-api/session/how-to/_evict-entity-from-a-session-csharp.mdx

Node.js @M4xymm - pls review these latest files (for version 7.1)
(For earlier versions – 7.0, 6.2, 6.0, and 5.4 – the content was simply copied over)

docs/client-api/session/_what-is-a-session-and-how-does-it-work-nodejs.mdx
(Just mentioned Evict in the "Unit of Work" section of the Session Overview article)

docs/client-api/session/how-to/_clear-a-session-nodejs.mdx
docs/client-api/session/how-to/_evict-entity-from-a-session-nodejs.mdx

Any fixes/improvements needed for other languages (Java, PHP, Python) should be handled in a separate PR.

</Tabs>

## Example I
## Evict an entity from the session's delete queue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arekpalinski
This is the related issue:
https://issues.hibernatingrhinos.com/issue/RavenDB-25297/Load-after-Delete-Evict-does-not-trigger-a-server-call

(The example here is fine, since it doesn't perform another load afterward)


## Syntax
* Use the `Clear()` method to clear the session’s state:
it **removes ALL tracked entities** and **cancels ALL pending operations** (e.g., _Store_, _Delete_).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But "removes ALL tracked entities" isn't something that is happening currently, right?

So we first need to check - https://issues.hibernatingrhinos.com/issue/RavenDB-25297/Load-after-Delete-Evict-does-not-trigger-a-server-call

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arekpalinski
That issue (RavenDB-25297) only occurs when Evict is used in the flow.
I just re-ran this to test again, and from what I see -
when calling Clear, all entities are cleared, including those from the delete queue, as expected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, right. It's about clearing. Everything okay then

@ppekrol ppekrol merged commit 569b078 into ravendb:main Nov 6, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants