"Not recently used" policy with custom user storage spi

I add “not recently used” policy and when I try to authenticate user it throws me “Datasource ‘’: JDBC resources leaked: 1 ResultSet(s) and 1 Statement(s)” exception. But when I unlink user from spi it works fine. Should I implement something in user storage spi?