Methods Summary |
---|
private synchronized void | decrementPoolSize()
poolSize--;
|
protected void | freeResource(ResourceHandle resourceHandle)
decrementPoolSize();
destroyResource(resourceHandle);
|
protected ResourceHandle | getUnenlistedResource(ResourceSpec spec, ResourceAllocator alloc, javax.transaction.Transaction tran)
ResourceHandle handle = null;
if(incrementPoolSize()){
try{
handle = createSingleResource(alloc);
}catch (PoolingException ex){
decrementPoolSize();
throw ex;
}
ResourceState state = new ResourceState();
handle.setResourceState(state);
state.setEnlisted(false);
setResourceStateToBusy(handle);
return handle;
}
_logger.info("Fail as poolSize : " + poolSize);
String msg = localStrings.getStringWithDefault(
"poolmgr.max.pool.size.reached",
"In-use connections equal max-pool-size therefore cannot allocate any more connections.");
throw new PoolingException(msg);
|
private synchronized boolean | incrementPoolSize()
if(poolSize >= maxPoolSize)
return false;
poolSize++;
return true;
|
protected synchronized void | initPool(ResourceSpec resourceSpec, ResourceAllocator allocator)
if (poolInitialized) {
return;
}
//nothing needs to be done as pooling is disabled
poolSize = 0;
poolInitialized = true;
|
protected ResourceHandle | prefetch(ResourceSpec spec, ResourceAllocator alloc, javax.transaction.Transaction tran)
return null;
|
public void | resourceErrorOccurred(ResourceHandle resourceHandle)
freeResource(resourceHandle);
|