I am working on a project in which we need to define agencies in other cities. We have the same application but separate database schema for each agency. I used one session factory. For each request we get the person's username and therefore we can recognize which agency they belongs to. We change the PostgreSQL search_path for that.
The problem is now with cache. Since we are changing schema constantly it seems cache does not work.
Our jobs (which are written with quartz scheduling) seem to have problem because we are changing schema constantly.
Any ideas?