I wanted to make a datasource that fails on each attempt (for testing purposes).
The way the pools are configured appears to be wrong because if I do this -
final BasicDataSource ds = new BasicDataSource();
ds.setDriverClassName(driverName);
ds.setUrl(url);
ds.setUsername(userName);
ds.setPassword(passwd);
ds.setMaxActive(0);
ds.setMaxIdle(0);
final Connection conn = ds.getConnection();
I expect to get an SQL Exception about exhausted pool. Instead it just gives
me a connection !!.
There is a workaround - use a null driver name - but that is silly - it should
be doing the right thing with the pool
See:
http://issues.apache.org/bugzilla/show_bug.cgi?id=29863