I have a below method from extending the hibernate EmptyInterceptor class in Spring boot. During the entity updates I’m getting stackOverflow issues due to recursive calls. executeSchedule() method contains a data fetch from DB. Getting this exception due to it. Any solution to avoid this recursive calls?
@Override
@Transactional(propagation = Propagation.MANDATORY)
public boolean onFlushDirty(
Object entity, Serializable id,
Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types
) {
executeSchedule(entity);
return true;
}