String securityDomain = dataSourceConfig.getSecurity() != null ? dataSourceConfig.getSecurity().getSecurityDomain()
: null;
// Select the correct connection manager
TransactionSupport.TransactionSupportLevel tsl = TransactionSupport.TransactionSupportLevel.XATransaction;
ConnectionManagerFactory cmf = new ConnectionManagerFactory();
ConnectionManager cm = cmf.createTransactional(tsl, pool, null, securityDomain, allocationRetry,
allocationRetryWaitMillis, getTransactionIntegration(), interleaving, xaResourceTimeout, isSameRMOverride,
wrapXAResource, padXid);
cm.setJndiName(jndiName);
return cm;
}