#InvalidDataAccessApiUsageException

1 messages · Page 1 of 1 (latest)

keen pagoda
#

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);
dapper pythonBOT
#

<@&1004656351647117403> please have a look, thanks.

dapper pythonBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

dapper pythonBOT
#

Closed the thread due to inactivity.

If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍

keen pagoda
#

still need help