xetorthio/jedis — pull request #429 by vmencik (2013-06-28 12:19:47+00:00)
Title: JedisFactory selects database to the one in its configuration before the instance is borrowed from the pool

Right now Jedis instances are reused by the pool. If the Redis database is changed using the SELECT command and then returned to the pool, the next time it is borrowed from the pool again the database is not the one configured for the pool.

To fix this, [activateObject method](http://commons.apache.org/proper/commons-pool/api-1.5.7/org/apache/commons/pool/PoolableObjectFactory.html#activateObject%28java.lang.Object%29) is implemented in JedisFactory. It will reset the Redis database back to the one configured for the pool if the current database is different.