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

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());
}
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);
@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.
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
2 Replies
JavaBot
JavaBot5mo ago
This post has been reserved for your question.
Hey @bambyzas! 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.
JavaBot
JavaBot5mo ago
Post Closed
This post has been closed by <@611623200756989972>.
Want results from more Discord servers?
Add your server