So apparently we have the need to create persistence units on the fly. Basically we have this web service and a bunch of identical schemas with identical domain classes. We want to be able to pass a query to the web service where the context path matches a schema. The first time that the service is queried then pass in that schema name and create the persistence unit on the fly and then using it every time thereafter and repeating the process every time a request is made of the service for a schema that has not yet been created.
Is this possible using Spring and JPA given all the building that has to be done at start up for normal PU creation? Is this brilliant idea scalable?