I think the `ThreadLocal` itself should never be set to null (and I would instantiate it eagerly in the constructor), only its thread-specific value should be. Otherwise a thread could see a null reference when another thread has executed a batch.