我有一个在应用程序开始时加载的配置表。如果我更改数据库表上的任何值,它不会反映在应用程序上,它会再次进行查询。
@Stateless()
@LocalBean()
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class DatosConfiguracionDAO {
private static final Logger log = Logger.getLogger(DatosConfiguracionDAO.class);
@PersistenceContext(unitName = Constantes.Conexiones.UNIT_PLACSP)
private EntityManager em;
public List<ConfiguracionEntity> findAllConfiguracion() throws GeacoPlacspException {
try {
TypedQuery<ConfiguracionEntity> query = em.createNamedQuery("ConfiguracionEntity.findAll",
ConfiguracionEntity.class);
return query.getResultList();
}catch(Exception e) {
log.error("findAllConfiguracion" + e);
throw new GeacoPlacspException(ErrorType.ERROR104,e.getMessage());
}
}
}
实体
@Entity
@Table(name=NOMBRE_TABLA_CONFIGURACION)
@NamedQuery(name="ConfiguracionEntity.findAll", query="SELECT c FROM ConfiguracionEntity c")
public class ConfiguracionEntity extends BaseEntity implements Serializable {
}
我正在使用 weblogic 12,重新启动 weblogic 是更新应用程序中的值的唯一方法