This function is Deterministic. H2 will use the cache if the function argument is the same. Extend Deterministic scalar function. Or set deterministic property to true.