} catch (EmptyStackException e) {
/* stack is empty. Create new connection */
try {
ctx = factory.connect();
} catch (Exception e1) {
throw new MapperTechnicalException(
"Error in creating connection from factory", e1);
}
} catch (NullPointerException e) {
/* pool is disabled */
throw new MapperTechnicalException(
"Pool closed while trying to connect");
}
/* done ? */
if (ctx != null)
break;