Currently, if a connection cannot be returned from the database pool, null is returned. As this is not documented, and as a SQLException is declared in the method signature, this is very confusing. Most implementors will try/catch for SQLException, but will not check for null. This introduced NullPointerExceptions (which are RuntimeExceptions, and therefor not handled by generic SQLExeption try/catches that usually surround code that involves database operations.
Not being able to return a connection from the database pool should trigger an SQLException to be thrown (the backend does this, but Openfire catches this and replaces it with a null value).