String localJndiName = jndiName; logFine("Allocating NonTxConnection"); logFine("Adding __nontx to jndiname"); } else { logFine("lookup happened from a __nontx datasource directly"); return allocateConnection(mcf, cxRequestInfo, localJndiName);
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo, String jndiNameToUse, Object conn) throws ResourceException { validateResourceAndPool(); PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager(); boolean resourceShareable = true; if(getLogger().isLoggable(Level.FINE)) { getLogger().log(Level.FINE, "poolmgr.no_resource_reference", jndiNameToUse); return internalGetConnection(mcf, defaultPrin, cxRequestInfo, resourceShareable, jndiNameToUse, conn, true); String msg = getLocalStrings().getString("con_mgr.null_userpass"); throw new ResourceException(msg); return internalGetConnection(mcf, null, cxRequestInfo, resourceShareable, jndiNameToUse, conn, false); } else { prin = ref.getResourcePrincipal(); if (prin == null) { if (getLogger().isLoggable(Level.FINE)) { getLogger().log(Level.FINE, "default-resource-principal not" + "specified for " + jndiNameToUse + ". Defaulting to" + " user/password specified in the pool"); return internalGetConnection(mcf, prin, cxRequestInfo, resourceShareable, jndiNameToUse, conn, false);
ManagedConnectionFactory freshMCF = pmd.getMCF(); if (getLogger().isLoggable(Level.INFO)) { if (!freshMCF.equals(mcf)) { getLogger().info("conmgr.mcf_not_equal"); if (getLogger().isLoggable(Level.FINE)) { logFine("ConnectionMgr: poolName " + poolInfo + " txLevel : " + txLevel); return getResource(txLevel, poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable); getLogger().log(Level.WARNING, "poolmgr.get_connection_failure", params); String i18nMsg = getLocalStrings().getString("con_mgr.error_creating_connection", ex.getMessage()); ResourceAllocationException rae = new ResourceAllocationException(i18nMsg); rae.initCause(ex);
ConnectionManagerImpl mgr = (ConnectionManagerImpl) getRuntime().obtainConnectionManager(poolInfo, forceNoLazyAssoc, resourceInfo); mgr.setJndiName(derivedJndiName); mgr.setRarName(moduleName); mgr.setLogicalName(logicalName); mgr.initialize();
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException { return this.allocateConnection(mcf, cxRequestInfo, jndiName); }
private Object getResource(int txLevel, PoolManager poolmgr, ManagedConnectionFactory mcf, ResourceSpec spec, Subject subject, ConnectionRequestInfo cxRequestInfo, ClientSecurityInfo info, ConnectorDescriptor desc, boolean shareable) throws PoolingException, ResourceAllocationException, IllegalStateException, RetryableUnavailableException { ResourceAllocator alloc; switch (txLevel) { case ConnectorConstants.NO_TRANSACTION_INT: alloc = new NoTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc); break; case ConnectorConstants.LOCAL_TRANSACTION_INT: alloc = new LocalTxConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable); break; case ConnectorConstants.XA_TRANSACTION_INT: if (rarName.equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) { shareable = false; } spec.markAsXA(); alloc = new ConnectorAllocator(poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable); return poolmgr.getResource(spec, alloc, info); default: String i18nMsg = getLocalStrings().getString("con_mgr.illegal_tx_level", txLevel + " "); throw new IllegalStateException(i18nMsg); } return poolmgr.getResource(spec, alloc, info); }
public static ConnectionManager getAvailableConnectionManager( PoolInfo poolInfo, boolean forceNoLazyAssoc, ResourceInfo resourceInfo) throws ConnectorRuntimeException { ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); boolean isLazyEnlist = pmd.isLazyEnlistable(); boolean isLazyAssoc = pmd.isLazyAssociatable(); ConnectionManagerImpl mgr = null; if (isLazyAssoc && !forceNoLazyAssoc) { logFine("Creating LazyAssociatableConnectionManager"); mgr = new LazyAssociatableConnectionManagerImpl(poolInfo, resourceInfo); }else if (isLazyEnlist) { logFine("Creating LazyEnlistableConnectionManager"); mgr = new LazyEnlistableConnectionManagerImpl(poolInfo, resourceInfo); } else { logFine("Creating plain ConnectionManager"); mgr = new ConnectionManagerImpl(poolInfo, resourceInfo); } return mgr; }
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo, String jndiNameToUse) throws ResourceException { return this.allocateConnection(mcf, cxRequestInfo, jndiNameToUse, null); }
String msg = getLocalStrings().getString("con_mgr.no_pool_meta_data", poolInfo); throw new ResourceException(poolInfo + ": " + msg);