Skip to content

Commit

Permalink
Added Transactional annotation to ensure connection obtained from db …
Browse files Browse the repository at this point in the history
…have autocommit false.
  • Loading branch information
whitingjr committed Sep 29, 2023
1 parent e3569e7 commit a6069eb
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ void removeIndex(String channel, int index) {
every = "{horreum.messagebus.retry.check:5m}",
delayed = "{horreum.messagebus.retry.delay:30s}",
concurrentExecution = Scheduled.ConcurrentExecution.SKIP)
@Transactional
public void retryFailedMessages() {

try(ScrollableResults<ChannelMessage> results = (ScrollableResults<ChannelMessage>) em.createNativeQuery("SELECT channel, id, testid, flags, message FROM messagebus WHERE \"timestamp\" + make_interval(secs => ?1) <= now()")
Expand Down

0 comments on commit a6069eb

Please sign in to comment.