Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 1a50253

Browse files
author
Martin Wahnschaffe
committed
SORMAS-Foundation#3914 switched CurrentUser back to RequestScoped due to NovatecConsulting/BeanTest#4
1 parent 686f2cb commit 1a50253

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

sormas-backend/src/main/java/de/symeda/sormas/backend/user/CurrentUser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
import java.io.Serializable;
44

5+
import javax.enterprise.context.RequestScoped;
56
import javax.transaction.TransactionScoped;
67

7-
@TransactionScoped
8+
@RequestScoped
9+
// FIXME @TransactionScoped would be better for performance, but is not support by novatec.bean-test (see their github #4)
810
public class CurrentUser implements Serializable {
911

1012
private static final long serialVersionUID = 1L;

sormas-backend/src/main/java/de/symeda/sormas/backend/user/CurrentUserService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import javax.ejb.LocalBean;
55
import javax.ejb.SessionContext;
66
import javax.ejb.Stateless;
7+
import javax.enterprise.context.RequestScoped;
78
import javax.enterprise.inject.Produces;
89
import javax.persistence.EntityManager;
910
import javax.persistence.PersistenceContext;
@@ -37,8 +38,9 @@ public class CurrentUserService {
3738
*/
3839
@Produces
3940
@CurrentUserQualifier
40-
@TransactionScoped
4141
@Transactional
42+
@RequestScoped
43+
// FIXME @TransactionScoped would be better for performance, but is not support by novatec.bean-test (see their github #4)
4244
public CurrentUser getCurrentUser() {
4345

4446
final String userName = context.getCallerPrincipal().getName();

0 commit comments

Comments
 (0)