Created
March 22, 2015 17:45
-
-
Save pofider/6af82ca9a91634293115 to your computer and use it in GitHub Desktop.
Flushing with enabled filter causes sometimes exceptions in NHibernate when updating collections.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UnfilteredFlushListener : DefaultFlushEventListener | |
{ | |
protected override void PerformExecutions(IEventSource session) | |
{ | |
var filter = session.GetEnabledFilter("multitenancy"); | |
session.DisableFilter("multitenancy"); | |
base.PerformExecutions(session); | |
if (filter != null) | |
session.EnabledFilters.Add("multitenancy", filter); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment