Skip to content

Commit

Permalink
#2 TransactionalEventListeners should explicitly declare the new tx b…
Browse files Browse the repository at this point in the history
…oundary
  • Loading branch information
openwms committed Jun 28, 2024
1 parent 001c6b4 commit 77a1279
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/org/openwms/core/uaa/impl/UAAEventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
*/
package org.openwms.core.uaa.impl;

import org.ameba.annotation.Measured;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.event.TransactionalEventListener;

/**
Expand All @@ -30,7 +33,9 @@ class UAAEventListener {

private static final Logger LOGGER = LoggerFactory.getLogger(UAAEventListener.class);

@Measured
@TransactionalEventListener
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void onPickOrderPositionSplitEvent(UserEvent event) {
var user = event.getSource();
user.wipePassword();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private static void assertRole(RoleVO vo) {

private static void assertRole(Role eo) {
assertThat(eo.getPersistentKey()).isNotBlank();
assertThat(eo.getOl()).isOne();
assertThat(eo.getName()).isNotBlank();
assertThat(eo.getDescription()).isNotBlank();
assertThat(eo.getImmutable()).isTrue();
Expand Down

0 comments on commit 77a1279

Please sign in to comment.