You are currently browsing legacy 3.5 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Session: How to clear a session?

To clear session state, that is to stop tracking entities and remove all pending commands, etc. Clear method is used from Advanced session operations.


void Clear();


session.Store(new Employee
					  FirstName = "John",
					  LastName = "Doe"


session.SaveChanges(); // nothing will happen