diff --git a/src/Spring/Spring.Core/Pool/Support/SimplePool.cs b/src/Spring/Spring.Core/Pool/Support/SimplePool.cs
index 4e017a97..d65dc91a 100644
--- a/src/Spring/Spring.Core/Pool/Support/SimplePool.cs
+++ b/src/Spring/Spring.Core/Pool/Support/SimplePool.cs
@@ -41,6 +41,7 @@ namespace Spring.Pool.Support
/// Doug Lea
/// Federico Spinazzi
/// Mark Pollack
+ /// Zbynek Vyskovsky, kvr@centrum.cz
public class SimplePool : IObjectPool
{
private readonly IPoolableObjectFactory factory;
@@ -60,19 +61,20 @@ namespace Spring.Pool.Support
///
/// The factory used to instantiate and manage the lifecycle of pooled objects.
///
- /// The initial size of the pool.
+ /// The maximum size of the pool.
+ /// The initial size of the pool.
///
/// If the supplied is .
///
///
/// If the supplied is less than or equal to zero.
///
- public SimplePool(IPoolableObjectFactory factory, int size)
+ public SimplePool(IPoolableObjectFactory factory, int maxSize, int initialSize)
{
AssertUtils.ArgumentNotNull(factory, "factory");
- this.available = new Semaphore(size);
+ this.available = new Semaphore(maxSize);
this.factory = factory;
- InitItems(size);
+ InitItems(initialSize);
}
///
@@ -145,7 +147,9 @@ namespace Spring.Pool.Support
}
if (!closed)
{
- throw new PoolException("No more valid objects in pool.");
+ object o = factory.MakeObject();
+ busy.Add(o);
+ return o;
}
else
{