Is there any way to get the name of the datasource (non-jta or jta) from a persistence unit via the EntityManagerFactory or EntityManager instances?
We need to do some JDBC work (for exotic data types) and are currently parsing the persistence.xml file ourselves to get the data source name (which is an awful thing to do) but would much rather be able to say
Connection conn = Utility.getConnection(EntityManger em)
or even
String datasource = Utility.getDataSource(EntityManager em)
.
Thanks, Mark