Skip to content
Advertisement

Spring Data JPA @Convert throws Operations Not Allowed exception

I am using @Convert annotation to encrypt and decrypt certain columns.

JavaScript

When I used the JPA query to fetch a list of the records, it is throwing the exception

JavaScript

In the Converter class, I am making an HTTP call to an external service to encrypt and decrypt the data using feign.

When the query get executed, it is decrypting the first entity in the list and the for loop stops there throwing the exception.

JavaScript

I searched the internet and all the answers point to being the connection getting closed. Since I have been using JPA, I am not managing connection open and close.

Is there something wrong in the Converter implementation. How can I solve this issue?

Thank You in advance.

Advertisement

Answer

It is probably not something to do with your @Convert.

  • Add @Transactional to the method executing this query or to the repository

    OR

  • Append &defaultResultSetHoldable=true to your spring.datasource.url

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement