same as HHH-7932, it is said the bug will be resolved on ORM 4, but in ORM5, this bug still remain. I think the solution is easy, storing end of next pool in the database instead of the beginning of next pool just work well