TESB-8910, make changes to EventRepositoryImpl instead of the logic of trigger for Derby/H2