}
}
ResourceManagerImpl rm = ResourceManagerImpl.create();
ConnectionPool cm = rm.createConnectionPool();
if (getName() != null)
cm.setName(getName());
cm.setMaxConnections(_maxConnections);
cm.setMaxActiveTime(_maxActiveTime);
ResourceArchive rar = null;
if (rar != null) {
String trans = rar.getTransactionSupport();
if (trans == null) { // guess XA
cm.setXATransaction(true);
cm.setLocalTransaction(true);
}
else if (trans.equals("XATransaction")) {
cm.setXATransaction(true);
cm.setLocalTransaction(true);
}
else if (trans.equals("NoTransaction")) {
cm.setXATransaction(false);
cm.setLocalTransaction(false);
}
else if (trans.equals("LocalTransaction")) {
cm.setXATransaction(false);
cm.setLocalTransaction(true);
}
}
/*
cm.setLocalTransactionOptimization(getLocalTransactionOptimization());
cm.setShareable(getShareable());
*/
Object connectionFactory;
try {
connectionFactory = cm.init(managedFactory);
cm.start();
BeanBuilder factory
= cdiManager.createBeanFactory(connectionFactory.getClass());
if (getName() != null) {