org.springframework.dao.InvalidDataAccessApiUsageException: You're trying to execute a @Procedure method without a surrounding transaction that keeps the connection open so that the ResultSet can actually be consumed; Make sure the consumer code uses @Transactional or any other way of declaring a (read-only) transaction
I'm trying to call stored procedures, but it doesn't work even with @Transactional annotation, what's the problem?:
@Transactional(readOnly = true)
@Procedure(procedureName = "get_expenses_by_month")
List<Expense> filterByMonth(int month);
@Transactional(readOnly = true)
@Procedure(procedureName = "get_last_week_expenses")
List<Expense> findLastWeek();
@Transactional(readOnly = true)
@Procedure(procedureName = "get_last_month_expenses")
List<Expense> findLastMonth();
@Transactional(readOnly = true)
@Procedure(procedureName = "get_expenses_by_year_interval")
List<Expense> filterByYearInterval(int start, int end);