How to deactivate elastic context so that a new one can be created?