Which specific exception could i catch in case Spring Data Jpa repository query gets timeout ?
Lets say that i have repository like this one:
public interface VoucherRepository extends CrudRepository<VoucherEntity, String> {
@Transactional(readOnly = true, timeout = 30)
VoucherEntity findByCode(String code);
List<VoucherEntity> findAllByCodeIn(List<String> codes);
}
Which exception would be seen by caller when timeout happens ?
I don't know how to simulate this scenario, bonus question would be how to do that?
Used database is PostrgreSQL.