if (persistenceUnit == null) {
String jtaDataSource = null;
// todo Persistence Unit Data Sources need to be global JNDI names
Object altDD = ejbModule.getEjbModule().getAltDDs().get("openejb-jar.xml");
if (altDD instanceof OpenejbJarType) {
ResourceLocatorType cmpConnectionFactory = ((OpenejbJarType) altDD).getCmpConnectionFactory();
if (cmpConnectionFactory != null) {
String datasourceName = cmpConnectionFactory.getResourceLink();
if (datasourceName != null) {
jtaDataSource = "?name=" + datasourceName;
}
}
}