Is there a way to dynamically add or remove persistence units dynamically from the persistence.xml file? My application is built on top of a system that lets end-users add or remove databases dynamically so there can theoretically be an infinite amount of datasources and persistence units. The datasources would need to be created dynamically as well on JBoss.
I have not found any kind of feasible way of doing this using the persistence layer. Please advise.