Add synchronization between session factory and manager