{
//do this both before and after render, since conversations
//and pageflows can begin during render
FacesManager.instance().prepareBackswitch(facesContext);
PersistenceContexts persistenceContexts = PersistenceContexts.instance();
if (persistenceContexts != null)
{
persistenceContexts.afterRender();
}
ExternalContext externalContext = facesContext.getExternalContext();
Manager.instance().endRequest( externalContext.getSessionMap() );
FacesLifecycle.endRequest(externalContext);