Tomcat 7 connection pool / JPA : Getting a specific connection
I am using Spring together with JPA and the Tomcat 7 connection pool.
How is it possible to specify that the EntityManager injected by Spring into a data access object should use a specific connection from the pool, not one taken at random?
In other words, the requirement is to initialize specific connections in the pool (so these connections see the database pre-configured in various states), to then 'label' these connections and to then get EntityManager / the transaction to use the connection with a specific label.
I know that Oracle UCP offers similar functionality, but we have had issues with Oracle UCP so we want to do the same thing with the Tomcat pool.