#service deletes DB records, but i still get `No results were returned by the query`

1 messages · Page 1 of 1 (latest)

toxic crane
#

hey guys. can smb help me out? i have this service:

public void createPaymentpaymentReversal(PaymentDTO paymentReversalRequest) throws NoEarlierPaymentException {
        Optional<Payment> earlierPayment=paymentRepository.findByTransactionId(paymentReversalRequest.getTransactionId());

        //some skipped stuff

        Payment payment=PaymentMapper.toEntity(paymentReversalRequest);
        paymentRepository.deleteByTransactionId(payment.getTransactionId());
    }

in the payment repo i have this method:

@Query(value = "delete from my_table where transaction_id= :transactionId", nativeQuery = true)
    void deleteByTransactionId(@Param("transactionId") String transactionId);

the records are deleted from the table, but for some reason i get:

2024-07-23 16:39:52.127 ERROR 28956 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper   : No results were returned by the query.
2024-07-23 16:39:52.139 ERROR 28956 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet] with root cause

org.postgresql.util.PSQLException: No results were returned by the query.

can smb help me out? thx

sinful spireBOT
#

This post has been reserved for your question.

Hey @toxic crane! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.