if (_registry.isMCFCreated(poolInfo)) {
return _registry.getManagedConnectionFactory(poolInfo);
} else {
ConnectorConnectionPool connectorConnectionPool = getConnectorConnectionPool(poolInfo, env);
ActiveResourceAdapter activeResourceAdapter = getResourceAdapter(connectorConnectionPool);
ClassLoader loader = activeResourceAdapter.getClassLoader();
ManagedConnectionFactory mcf = activeResourceAdapter.
createManagedConnectionFactory(connectorConnectionPool, loader);
if (mcf != null) {
//validate MCF before it is used or related pooling infrastructure is created.
validateMCF(mcf, activeResourceAdapter.getModuleName());
ResourcePrincipal prin =
getDefaultResourcePrincipal(poolInfo, mcf, env);
Subject s = ConnectionPoolObjectsUtils.createSubject(mcf, prin);
int txSupport = connectorConnectionPool.getTransactionSupport();
//JSR-322 : check the runtime transaction level support of MCF and use appropriately.
if (mcf instanceof javax.resource.spi.TransactionSupport) {
TransactionSupport.TransactionSupportLevel mcfTS =
((javax.resource.spi.TransactionSupport) mcf).getTransactionSupport();
int containerTxSupport = ConnectionPoolObjectsUtils.convertSpecTxSupportToContainerTxSupport(mcfTS);
boolean isValidTxSupportLevel = ConnectionPoolObjectsUtils.isTxSupportConfigurationSane(
containerTxSupport, activeResourceAdapter.getModuleName());
if (isValidTxSupportLevel) {
txSupport = containerTxSupport;
} else {
Object params[] = { mcfTS, activeResourceAdapter.getModuleName() };
String i18nMsg = localStrings.getString("ccp_adm_service.incorrect_tx_support", params);
ConnectorRuntimeException cre = new
ConnectorRuntimeException(i18nMsg);
_logger.log(Level.SEVERE, "rardeployment.incorrect_tx_support",
connectorConnectionPool.getName());