title: How to delete detached proxies in NHibernate
body: <p>When we try to delete detached proxies nhibernate throws a mapping exception:</p>
  
  <pre><code>NHibernate.MappingException: No persister for: SomeClassProxy
     bei NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName)
     bei NHibernate.Impl.SessionImpl.GetEntityPersister(String entityName, Object obj)
     bei NHibernate.Event.Default.DefaultDeleteEventListener.OnDelete(DeleteEvent event, ISet transientEntities)
     bei NHibernate.Impl.SessionImpl.FireDelete(DeleteEvent event)
     bei NHibernate.Impl.SessionImpl.Delete(Object obj)
     ...
  </code></pre>
  
  <p>The objects are detached because they are primary loaded to show them to the user. Therefore the session is closed after loading.
  We already tried reattaching them using <code>Session.Lock</code> but that fails with the same exception.</p>
  
  <p>Typically the cause of this type of exception seems to be a wrong implemented interceptor. But we do not use any interceptors...</p>
  
  <p>What is the correct way to delete detached proxies?<br>
  Why does nhibernate not recognize that these objects are proxies and select the persister for the base type?</p>
  
  <p>We are using NHibernate 3.3.1.</p>