fixed missing transaction handling
This commit is contained in:
@ -30,6 +30,7 @@ import javax.ejb.LockType;
|
||||
import javax.ejb.Singleton;
|
||||
import javax.ejb.Startup;
|
||||
import javax.ejb.TransactionAttribute;
|
||||
import javax.ejb.TransactionAttributeType;
|
||||
import static javax.ejb.TransactionAttributeType.REQUIRES_NEW;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.EntityManager;
|
||||
@ -70,6 +71,8 @@ public class ConfigService implements Serializable {
|
||||
* more than one value is defined for the given key but none of the values
|
||||
* is defined for the system user
|
||||
*/
|
||||
@Lock(LockType.READ)
|
||||
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
|
||||
public String getConfigValue(String configKey) throws ConfigException {
|
||||
Query query = em.createNamedQuery("ConfigEntity.findByConfigKey");
|
||||
query.setParameter("application", application);
|
||||
@ -95,6 +98,8 @@ public class ConfigService implements Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
@Lock(LockType.READ)
|
||||
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
|
||||
public String getConfigValue(String configKey, String defaultValue) throws ConfigException {
|
||||
return getConfigValue(configKey, defaultValue, false);
|
||||
}
|
||||
@ -121,6 +126,8 @@ public class ConfigService implements Serializable {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
@Lock(LockType.READ)
|
||||
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
|
||||
public String getConfigValue(String configKey, Account account, boolean fallbackToSystem) throws ConfigException {
|
||||
Query query = em.createNamedQuery("ConfigEntity.findByConfigKeyAndAccount");
|
||||
query.setParameter("application", application);
|
||||
|
||||
Reference in New Issue
Block a user