Enables tracking changes made to persistent objects.
Units of work (ExplicitUnitOfWork and UnitOfWork) automatically track changes made to persistent objects within their scope. In sessions, you need to call the BeginTrackingChanges method to enable tracking changes. To determine if changes are currently being tracked in a session, use the Session.TrackingChanges property.
Calling the BeginTrackingChanges method automatically starts a transaction (an explicit transaction in an explicit unit of work) and raises the Session.BeforeBeginTrackingChanges and Session.AfterBeginTrackingChanges events, allowing you to monitor progress.
If the Session.TrackingChanges property returns true, calling the BeginTrackingChanges method throws an exception.