The code added from changeset 9b2e0aac2d9c does not work anymore because the method has moved on the Database object and it requires a connection as parameter. So we add cache on the returned value to prevent to consume unnecessary connection. issue5818